Changeset 89777 in webkit


Ignore:
Timestamp:
Jun 26, 2011 6:47:50 PM (13 years ago)
Author:
Dimitri Glazkov
Message:

2011-06-26 Dimitri Glazkov <Dimitri Glazkov>

Reviewed by Adam Barth.

FileList::filenames should be FileList::paths, because it's more accurate.
https://bugs.webkit.org/show_bug.cgi?id=63414

Refactoring, no change in behavior.

  • fileapi/FileList.cpp: (WebCore::FileList::paths): Renamed from filenames.
  • fileapi/FileList.h:
  • html/FileInputType.cpp: (WebCore::FileInputType::handleDOMActivateEvent): Changed to use filenames, also fixed a reach-unto-thyself whoopsie. (WebCore::FileInputType::requestIcon): Ditto. (WebCore::FileInputType::filesChosen): Ditto.
  • rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::fileTextValue): Ditto.
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89774 r89777  
     12011-06-26  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        FileList::filenames should be FileList::paths, because it's more accurate.
     6        https://bugs.webkit.org/show_bug.cgi?id=63414
     7
     8        Refactoring, no change in behavior.
     9
     10        * fileapi/FileList.cpp:
     11        (WebCore::FileList::paths): Renamed from filenames.
     12        * fileapi/FileList.h:
     13        * html/FileInputType.cpp:
     14        (WebCore::FileInputType::handleDOMActivateEvent): Changed to use filenames, also fixed a reach-unto-thyself whoopsie.
     15        (WebCore::FileInputType::requestIcon): Ditto.
     16        (WebCore::FileInputType::filesChosen): Ditto.
     17        * rendering/RenderFileUploadControl.cpp:
     18        (WebCore::RenderFileUploadControl::fileTextValue): Ditto.
     19
    1202011-06-26  Young Han Lee  <joybro@company100.net>
    221
  • trunk/Source/WebCore/fileapi/FileList.cpp

    r89523 r89777  
    4242}
    4343
    44 Vector<String> FileList::filenames() const
     44Vector<String> FileList::paths() const
    4545{
    46     Vector<String> filenames;
     46    Vector<String> paths;
    4747    for (unsigned i = 0; i < m_files.size(); ++i)
    48         filenames.append(m_files[i]->path());
     48        paths.append(m_files[i]->path());
    4949
    50     return filenames;
     50    return paths;
    5151}
    5252
  • trunk/Source/WebCore/fileapi/FileList.h

    r89523 r89777  
    4848        void clear() { m_files.clear(); }
    4949        void append(PassRefPtr<File> file) { m_files.append(file); }
    50         Vector<String> filenames() const;
     50        Vector<String> paths() const;
    5151
    5252    private:
  • trunk/Source/WebCore/html/FileInputType.cpp

    r89535 r89777  
    148148#endif
    149149        settings.acceptTypes = input->accept();
    150         ASSERT(input->files());
    151         settings.selectedFiles = input->files()->filenames();
     150        settings.selectedFiles = m_fileList->paths();
    152151        chrome->runOpenPanel(input->document()->frame(), newFileChooser(settings));
    153152    }
     
    253252}
    254253
    255 void FileInputType::requestIcon(const Vector<String>& filenames)
    256 {
    257     if (!filenames.size())
     254void FileInputType::requestIcon(const Vector<String>& paths)
     255{
     256    if (!paths.size())
    258257        return;
    259258
    260259    if (Chrome* chrome = this->chrome())
    261         chrome->loadIconForFiles(filenames, newFileIconLoader());
    262 }
    263 
    264 void FileInputType::filesChosen(const Vector<String>& filenames)
     260        chrome->loadIconForFiles(paths, newFileIconLoader());
     261}
     262
     263void FileInputType::filesChosen(const Vector<String>& paths)
    265264{
    266265    HTMLInputElement* input = element();
    267     setFileList(filenames);
     266    setFileList(paths);
    268267
    269268    input->setFormControlValueMatchesRenderer(true);
     
    271270    input->setNeedsValidityCheck();
    272271
    273     requestIcon(filenames);
     272    requestIcon(paths);
    274273
    275274    if (input->renderer())
  • trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp

    r89733 r89777  
    211211    HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
    212212    ASSERT(input->files());
    213     return theme()->fileListNameForWidth(input->files()->filenames(), style()->font(), maxFilenameWidth());
     213    return theme()->fileListNameForWidth(input->files()->paths(), style()->font(), maxFilenameWidth());
    214214}
    215215   
Note: See TracChangeset for help on using the changeset viewer.