2011-06-22 Dimitri Glazkov <dglazkov@chromium.org>
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2011 06:04:50 +0000 (06:04 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2011 06:04:50 +0000 (06:04 +0000)
commit2d395b3fa6909c803727db63d60e49111a16bb3d
tree78696b39c2188b11830a23f8b7acdbc3ca16aa9a
parent1879ad4c361c7cd89aa3bbce93e664cc2c34dabb
2011-06-22  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Kent Tamura.

        Move file-choosing and icon-loading management to FileInputType
        https://bugs.webkit.org/show_bug.cgi?id=62069

        1) Moved the duties of FileChooserClient and FileIconLoaderClient from
        RenderFileUploadControl to FileInputType, along with all of the
        supporting functions.

        2) Moved Icon ownership to FileInputType and exposed accessor on
        HTMInputElement to allow RenderFileUploadControl to query current icon.

        As a result, RenderFileUploadControl is now completely stateless, which is
        neat and clean.

        Refactoring, covered by existing tests.

        * html/FileInputType.cpp:
        (WebCore::FileInputType::handleDOMActivateEvent): Moved logic here from RenderFileUploadControl.
        (WebCore::FileInputType::requestIcon): Ditto.
        (WebCore::FileInputType::filesChosen): Ditto.
        (WebCore::FileInputType::receiveDropForDirectoryUpload): Ditto.
        (WebCore::FileInputType::updateRendering): Ditto.
        (WebCore::FileInputType::chrome): Ditto.
        (WebCore::FileInputType::receiveDroppedFiles): Ditto.
        (WebCore::FileInputType::icon): Added.
        * html/FileInputType.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::setValueFromRenderer): Updated comment.
        (WebCore::HTMLInputElement::receiveDroppedFiles): Added to replace setFileListFromRenderer.
        (WebCore::HTMLInputElement::icon): Added.
        * html/HTMLInputElement.h:
        * html/InputType.cpp:
        (WebCore::InputType::receiveDroppedFiles): Added.
        (WebCore::InputType::icon): Added.
        * html/InputType.h:
        * page/DragController.cpp:
        (WebCore::DragController::concludeEditDrag): Changed to use HTMLInputElement. Ahh, nice and clean!
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::RenderFileUploadControl): Removed code that is no longer necessary.
        (WebCore::RenderFileUploadControl::updateFromElement): Ditto.
        (WebCore::RenderFileUploadControl::maxFilenameWidth): Changed to use HTMLInputElement icon accessor.
        (WebCore::RenderFileUploadControl::paintObject): Ditto.
        * rendering/RenderFileUploadControl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89535 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/FileInputType.cpp
Source/WebCore/html/FileInputType.h
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/InputType.cpp
Source/WebCore/html/InputType.h
Source/WebCore/page/DragController.cpp
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderFileUploadControl.h