Title: [97910] trunk/Source/WebKit/chromium
- Revision
- 97910
- Author
- [email protected]
- Date
- 2011-10-19 18:47:45 -0700 (Wed, 19 Oct 2011)
Log Message
[Chromium]: Move from FileChooserSettings deprecatedAcceptType to acceptMIMETypes
https://bugs.webkit.org/show_bug.cgi?id=70003
Reviewed by Darin Fisher.
* public/WebFileChooserParams.h:
Add acceptMIMETypes, and make acceptTypes deprecated.
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::runOpenPanel):
- Set WebFileChooserParams::acceptMIMETypes
- Set a joined string to WebFileChooserParams::acceptTypes until we remove acceptTypes.
Modified Paths
Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (97909 => 97910)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-10-20 01:47:26 UTC (rev 97909)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-10-20 01:47:45 UTC (rev 97910)
@@ -1,3 +1,17 @@
+2011-10-19 Kent Tamura <[email protected]>
+
+ [Chromium]: Move from FileChooserSettings deprecatedAcceptType to acceptMIMETypes
+ https://bugs.webkit.org/show_bug.cgi?id=70003
+
+ Reviewed by Darin Fisher.
+
+ * public/WebFileChooserParams.h:
+ Add acceptMIMETypes, and make acceptTypes deprecated.
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::runOpenPanel):
+ - Set WebFileChooserParams::acceptMIMETypes
+ - Set a joined string to WebFileChooserParams::acceptTypes until we remove acceptTypes.
+
2011-10-19 Adam Bergkvist <[email protected]>
Update MediaStream to use WebCore platform interfaces
Modified: trunk/Source/WebKit/chromium/public/WebFileChooserParams.h (97909 => 97910)
--- trunk/Source/WebKit/chromium/public/WebFileChooserParams.h 2011-10-20 01:47:26 UTC (rev 97909)
+++ trunk/Source/WebKit/chromium/public/WebFileChooserParams.h 2011-10-20 01:47:45 UTC (rev 97910)
@@ -54,7 +54,13 @@
// The dialog may restrict selectable files to the specified MIME types.
// This value comes from an 'accept' attribute value of an INPUT element, so it
// might be an incorrectly formatted string.
+ // DEPRECATED: Use acceptMIMETypes;
WebString acceptTypes;
+ // This contains MIME type strings such as "audio/*" "text/plain".
+ // The dialog may restrict selectable files to the specified MIME types.
+ // This list comes from an 'accept' attribute value of an INPUT element, and
+ // it contains only lower-cased MIME type strings of which format is valid.
+ WebVector<WebString> acceptMIMETypes;
// |selectedFiles| has filenames which a file upload control already selected.
// A WebViewClient implementation may ask a user to select
// - removing a file from the selected files,
Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp (97909 => 97910)
--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp 2011-10-20 01:47:26 UTC (rev 97909)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp 2011-10-20 01:47:45 UTC (rev 97910)
@@ -91,6 +91,7 @@
#include "WebWindowFeatures.h"
#include "WindowFeatures.h"
#include "WrappedResourceRequest.h"
+#include <wtf/text/StringBuilder.h>
#include <wtf/text/StringConcatenate.h>
#include <wtf/unicode/CharacterNames.h>
@@ -670,7 +671,16 @@
#else
params.directory = false;
#endif
- params.acceptTypes = fileChooser->settings().deprecatedAcceptTypes;
+ params.acceptMIMETypes = fileChooser->settings().acceptMIMETypes;
+ // FIXME: Remove WebFileChooserParams::acceptTypes.
+ StringBuilder builder;
+ const Vector<String>& acceptTypeList = fileChooser->settings().acceptMIMETypes;
+ for (unsigned i = 0; i < acceptTypeList.size(); ++i) {
+ if (i > 0)
+ builder.append(',');
+ builder.append(acceptTypeList[i]);
+ }
+ params.acceptTypes = builder.toString();
params.selectedFiles = fileChooser->settings().selectedFiles;
if (params.selectedFiles.size() > 0)
params.initialValue = params.selectedFiles[0];
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes