Title: [124285] trunk/Source/WebKit/blackberry
Revision
124285
Author
[email protected]
Date
2012-07-31 19:39:33 -0700 (Tue, 31 Jul 2012)

Log Message

[BlackBerry] Pass all file chooser settings to clients
https://bugs.webkit.org/show_bug.cgi?id=92237

Patch by Robin Cao <[email protected]> on 2012-07-31
Reviewed by Rob Buis.

Expose all file chooser settings to clients.

* Api/WebPageClient.h:
* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::runOpenPanel):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPageClient.h (124284 => 124285)


--- trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2012-08-01 02:28:33 UTC (rev 124284)
+++ trunk/Source/WebKit/blackberry/Api/WebPageClient.h	2012-08-01 02:39:33 UTC (rev 124285)
@@ -167,7 +167,7 @@
     virtual void openDateTimePopup(int type, const WebString& value, const WebString& min, const WebString& max, double step) = 0;
     virtual void openColorPopup(const WebString& value) = 0;
 
-    virtual bool chooseFilenames(bool allowMultiple, const WebString& acceptTypes, const SharedArray<WebString>& initialFiles, SharedArray<WebString>& chosenFiles) = 0;
+    virtual bool chooseFilenames(bool allowMultiple, const SharedArray<WebString>& acceptTypes, const SharedArray<WebString>& initialFiles, const WebString& capture, SharedArray<WebString>& chosenFiles) = 0;
 
     virtual void loadPluginForMimetype(int, int width, int height, const SharedArray<WebString>& paramNames, const SharedArray<WebString>& paramValues, const char* url) = 0;
     virtual void notifyPluginRectChanged(int, Platform::IntRect rectChanged) = 0;

Modified: trunk/Source/WebKit/blackberry/ChangeLog (124284 => 124285)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-08-01 02:28:33 UTC (rev 124284)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-08-01 02:39:33 UTC (rev 124285)
@@ -1,3 +1,16 @@
+2012-07-31  Robin Cao  <[email protected]>
+
+        [BlackBerry] Pass all file chooser settings to clients
+        https://bugs.webkit.org/show_bug.cgi?id=92237
+
+        Reviewed by Rob Buis.
+
+        Expose all file chooser settings to clients.
+
+        * Api/WebPageClient.h:
+        * WebCoreSupport/ChromeClientBlackBerry.cpp:
+        (WebCore::ChromeClientBlackBerry::runOpenPanel):
+
 2012-07-31  Mike Fenton  <[email protected]>
 
         [BlackBerry] Fix crash in InputHandler spell checking.

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp (124284 => 124285)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2012-08-01 02:28:33 UTC (rev 124284)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2012-08-01 02:39:33 UTC (rev 124285)
@@ -513,14 +513,25 @@
     for (unsigned i = 0; i < numberOfInitialFiles; ++i)
         initialFiles[i] = chooser->settings().selectedFiles[i];
 
+    SharedArray<WebString> acceptMIMETypes;
+    unsigned numberOfTypes = chooser->settings().acceptMIMETypes.size();
+    if (numberOfTypes > 0)
+        acceptMIMETypes.reset(new WebString[numberOfTypes], numberOfTypes);
+    for (unsigned i = 0; i < numberOfTypes; ++i)
+        acceptMIMETypes[i] = chooser->settings().acceptMIMETypes[i];
+
+    WebString capture;
+#if ENABLE(MEDIA_CAPTURE)
+    capture = chooser->settings().capture;
+#endif
+
     SharedArray<WebString> chosenFiles;
 
     {
         PageGroupLoadDeferrer deferrer(m_webPagePrivate->m_page, true);
         TimerBase::fireTimersInNestedEventLoop();
 
-        // FIXME: Use chooser->settings().acceptMIMETypes instead of WebString() for the second parameter.
-        if (!m_webPagePrivate->m_client->chooseFilenames(chooser->settings().allowsMultipleFiles, WebString(), initialFiles, chosenFiles))
+        if (!m_webPagePrivate->m_client->chooseFilenames(chooser->settings().allowsMultipleFiles, acceptMIMETypes, initialFiles, capture, chosenFiles))
             return;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to