Changeset 53269 in webkit
- Timestamp:
- Jan 14, 2010 9:38:56 AM (14 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r53238 r53269 1 2010-01-14 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Introduce WebFileChooserParams to convey parameters for 6 WebViewClient::runFileChooser(), and add new parameters to it. 7 https://bugs.webkit.org/show_bug.cgi?id=32473 8 9 The new parameters are 10 - selected file names 11 - "accept" attribute value 12 13 * WebKit.gyp: Add WebFileChooserParams.h 14 * public/WebFileChooserParams.h: Added. 15 * public/WebViewClient.h: 16 (WebKit::WebViewClient::runFileChooser): 17 Add runFileChooser() with WebFileChooserParams, and mark the old one deprecated. 18 * src/ChromeClientImpl.cpp: 19 (WebKit::ChromeClientImpl::runOpenPanel): 20 Call the new runFileChooser() first, then call the old 21 runFileChooser() if the new one failed. 22 1 23 2010-01-13 Kenneth Russell <kbr@google.com> 2 24 -
trunk/WebKit/chromium/WebKit.gyp
r53144 r53269 109 109 'public/WebElement.h', 110 110 'public/WebFileChooserCompletion.h', 111 'public/WebFileChooserParams.h', 111 112 'public/WebFindOptions.h', 112 113 'public/WebFrame.h', -
trunk/WebKit/chromium/public/WebViewClient.h
r53210 r53269 35 35 #include "WebEditingAction.h" 36 36 #include "WebFileChooserCompletion.h" 37 #include "WebFileChooserParams.h" 37 38 #include "WebString.h" 38 39 #include "WebTextAffinity.h" … … 161 162 // Dialogs ------------------------------------------------------------- 162 163 164 // Deprecated. Use another runFileChooser() below instead. 165 virtual bool runFileChooser( 166 bool multiSelect, const WebString& title, 167 const WebString& initialValue, WebFileChooserCompletion*) { return false; } 168 163 169 // This method returns immediately after showing the dialog. When the 164 170 // dialog is closed, it should call the WebFileChooserCompletion to 165 171 // pass the results of the dialog. Returns false if 166 172 // WebFileChooseCompletion will never be called. 167 virtual bool runFileChooser( 168 bool multiSelect, const WebString& title, 169 const WebString& initialValue, WebFileChooserCompletion*) { return false; } 173 virtual bool runFileChooser(const WebFileChooserParams&, 174 WebFileChooserCompletion*) { return false; } 170 175 171 176 // Displays a modal alert dialog containing the given message. Returns -
trunk/WebKit/chromium/src/ChromeClientImpl.cpp
r50961 r53269 561 561 return; 562 562 563 bool multipleFiles = fileChooser->allowsMultipleFiles();564 565 WebString suggestion;566 if (fileChooser->filenames().size() > 0)567 suggestion = fileChooser->filenames()[0];568 563 WebFileChooserParams params; 564 params.multiSelect = fileChooser->allowsMultipleFiles(); 565 params.acceptTypes = fileChooser->acceptTypes(); 566 params.selectedFiles = fileChooser->filenames(); 567 if (params.selectedFiles.size() > 0) 568 params.initialValue = params.selectedFiles[0]; 569 569 WebFileChooserCompletionImpl* chooserCompletion = 570 570 new WebFileChooserCompletionImpl(fileChooser); 571 bool ok = client->runFileChooser(multipleFiles, 572 WebString(), 573 suggestion, 574 chooserCompletion); 575 if (!ok) { 576 // Choosing failed, so do callback with an empty list. 577 chooserCompletion->didChooseFile(WebVector<WebString>()); 578 } 571 572 if (client->runFileChooser(params, chooserCompletion)) 573 return; 574 575 // Choosing with new function failed, so fallback to old function. 576 if (client->runFileChooser(params.multiSelect, 577 params.title, 578 params.initialValue, 579 chooserCompletion)) 580 return; 581 582 // Choosing with the old function failed, so do callback with an empty list. 583 chooserCompletion->didChooseFile(WebVector<WebString>()); 579 584 } 580 585
Note: See TracChangeset
for help on using the changeset viewer.