2011-06-18 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Jun 2011 17:00:27 +0000 (17:00 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Jun 2011 17:00:27 +0000 (17:00 +0000)
commitb917b0ec319a309224b3fb99e5fe24155574609e
tree7ca2c0016dd503560871b542316a1ad93a0a3973
parent7ea50fa4f8645d40023e5b33db1292a4ccb90905
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        Loading an icon and choosing files have similar async nature, but completely different
        lifetimes: FileChooser should only exist when we are actually attempting to choose a file,
        not anytime we need to render an input with a proper icon.

        This patch introduces FileIconLoader, a separate abstraction for loading an icon, and removes
        any notion of an icon from the FileChooser.

        Also, the loaded icon is now stored on the RenderFileUploadControl, which better matches its
        purpose.

        Refactoring, covered by existing tests.

        * CMakeLists.txt: Added FileIconLoader to build system.
        * GNUmakefile.list.am: Ditto.
        * WebCore.exp.in: Updated.
        * WebCore.gypi: Added FileIconLoader to build system.
        * WebCore.pro: Ditto.
        * WebCore.vcproj/WebCore.vcproj: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * loader/EmptyClients.h: Updated.
        (WebCore::EmptyChromeClient::loadIconForFiles): Renamed function to better reflect what it does.
        * page/Chrome.cpp:
        (WebCore::Chrome::loadIconForFiles): Ditto.
        * page/Chrome.h: Ditto.
        * page/ChromeClient.h: Ditto.
        * platform/FileChooser.cpp:
        (WebCore::FileChooser::FileChooser): Removed now-unnecessary bool.
        (WebCore::FileChooser::create): Removed the tangled web.
        (WebCore::FileChooser::clear): Removed icon-related code.
        (WebCore::FileChooser::chooseFiles): Ditto.
        * platform/FileChooser.h:
        * platform/FileIconLoader.cpp: Copied from Source/WebCore/platform/FileChooser.cpp.
        (WebCore::FileIconLoaderClient::~FileIconLoaderClient): Added.
        (WebCore::FileIconLoader::create): Added.
        (WebCore::FileIconLoader::disconnectClient): Added.
        (WebCore::FileIconLoader::notifyFinished): Added.
        (WebCore::FileIconLoader::FileIconLoader): Added.
        * platform/FileIconLoader.h: Copied from Source/WebCore/platform/FileChooser.cpp.
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::RenderFileUploadControl): Added new member initializations.
        (WebCore::RenderFileUploadControl::~RenderFileUploadControl): Added FileIconLoader disconnect.s
        (WebCore::RenderFileUploadControl::requestIcon): Added a helper.
        (WebCore::RenderFileUploadControl::valueChanged): Changed to request an icon load.
        (WebCore::RenderFileUploadControl::updateRendering): Added implementation of FileIconLoaderClient func.
        (WebCore::RenderFileUploadControl::updateFromElement): Added clearing of icon.
        (WebCore::RenderFileUploadControl::maxFilenameWidth): Changed to use new member directly.
        (WebCore::RenderFileUploadControl::paintObject): Ditto.
        (WebCore::RenderFileUploadControl::fileTextValue): Ditto.
        * rendering/RenderFileUploadControl.h: Updated decls.
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        * src/ChromeClientImpl.cpp:
        (WebKit::ChromeClientImpl::loadIconForFiles): Renamed to better reflect the intent.
        * src/ChromeClientImpl.h: Ditto.
        * src/WebIconLoadingCompletionImpl.cpp:
        (WebKit::WebIconLoadingCompletionImpl::WebIconLoadingCompletionImpl): Changed to use FileIconLoader.
        (WebKit::WebIconLoadingCompletionImpl::didLoadIcon): Ditto.
        * src/WebIconLoadingCompletionImpl.h: Dito.
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        * WebCoreSupport/ChromeClientEfl.cpp:
        (WebCore::ChromeClientEfl::loadIconForFiles): Renamed.
        * WebCoreSupport/ChromeClientEfl.h:
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        * WebCoreSupport/ChromeClientGtk.cpp:
        (WebKit::ChromeClient::loadIconForFiles): Renamed.
        * WebCoreSupport/ChromeClientGtk.h:
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        * WebCoreSupport/ChromeClientHaiku.cpp:
        (WebCore::ChromeClientHaiku::loadIconForFiles): Renamed.
        * WebCoreSupport/ChromeClientHaiku.h:
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        * WebCoreSupport/WebChromeClient.h:
        * WebCoreSupport/WebChromeClient.mm:
        (WebChromeClient::loadIconForFiles): Renamed.
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        * WebCoreSupport/ChromeClientQt.cpp:
        (WebCore::ChromeClientQt::loadIconForFiles): Renamed.
        * WebCoreSupport/ChromeClientQt.h:
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        * WebCoreSupport/WebChromeClient.cpp:
        (WebChromeClient::loadIconForFiles): Renamed.
        * WebCoreSupport/WebChromeClient.h:
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        * WebCoreSupport/ChromeClientWinCE.cpp:
        (WebKit::ChromeClientWinCE::loadIconForFiles): Renamed.
        * WebCoreSupport/ChromeClientWinCE.h:
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        * WebKitSupport/ChromeClientWx.cpp:
        (WebCore::ChromeClientWx::chooseIconForFiles): Renamed.
        * WebKitSupport/ChromeClientWx.h:
2011-06-18  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        Separate concerns of loading file icons and choosing files.
        https://bugs.webkit.org/show_bug.cgi?id=62931

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::loadIconForFiles): Renamed.
        * WebProcess/WebCoreSupport/WebChromeClient.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
51 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/Chrome.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/platform/FileChooser.cpp
Source/WebCore/platform/FileChooser.h
Source/WebCore/platform/FileIconLoader.cpp [new file with mode: 0644]
Source/WebCore/platform/FileIconLoader.h [new file with mode: 0644]
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderFileUploadControl.h
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ChromeClientImpl.cpp
Source/WebKit/chromium/src/ChromeClientImpl.h
Source/WebKit/chromium/src/WebIconLoadingCompletionImpl.cpp
Source/WebKit/chromium/src/WebIconLoadingCompletionImpl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
Source/WebKit/haiku/ChangeLog
Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp
Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
Source/WebKit/wx/WebKitSupport/ChromeClientWx.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h