Title: [99606] trunk/Source/WebKit2
- Revision
- 99606
- Author
- jon...@apple.com
- Date
- 2011-11-08 12:31:25 -0800 (Tue, 08 Nov 2011)
Log Message
[WK2] Expose acceptMIMETypes for file inputs
https://bugs.webkit.org/show_bug.cgi?id=71836
<rdar://problem/10407367>
Reviewed by Anders Carlsson.
* Shared/WebOpenPanelParameters.cpp:
(WebKit::WebOpenPanelParameters::acceptMIMETypes):
* Shared/WebOpenPanelParameters.h:
* UIProcess/API/C/WKOpenPanelParameters.cpp:
(WKOpenPanelParametersCopyAcceptedMIMETypes):
* UIProcess/API/C/WKOpenPanelParameters.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (99605 => 99606)
--- trunk/Source/WebKit2/ChangeLog 2011-11-08 20:20:08 UTC (rev 99605)
+++ trunk/Source/WebKit2/ChangeLog 2011-11-08 20:31:25 UTC (rev 99606)
@@ -1,3 +1,18 @@
+2011-11-08 Jon Lee <jon...@apple.com>
+
+ [WK2] Expose acceptMIMETypes for file inputs
+ https://bugs.webkit.org/show_bug.cgi?id=71836
+ <rdar://problem/10407367>
+
+ Reviewed by Anders Carlsson.
+
+ * Shared/WebOpenPanelParameters.cpp:
+ (WebKit::WebOpenPanelParameters::acceptMIMETypes):
+ * Shared/WebOpenPanelParameters.h:
+ * UIProcess/API/C/WKOpenPanelParameters.cpp:
+ (WKOpenPanelParametersCopyAcceptedMIMETypes):
+ * UIProcess/API/C/WKOpenPanelParameters.h:
+
2011-11-08 Zan Dobersek <zandober...@gmail.com>
[WK2][GTK] The default database & local storage directory names should note they exist for Gtk port's needs
Modified: trunk/Source/WebKit2/Shared/WebOpenPanelParameters.cpp (99605 => 99606)
--- trunk/Source/WebKit2/Shared/WebOpenPanelParameters.cpp 2011-11-08 20:20:08 UTC (rev 99605)
+++ trunk/Source/WebKit2/Shared/WebOpenPanelParameters.cpp 2011-11-08 20:31:25 UTC (rev 99606)
@@ -26,6 +26,10 @@
#include "config.h"
#include "WebOpenPanelParameters.h"
+#include "ImmutableArray.h"
+#include "WebString.h"
+#include <wtf/Vector.h>
+
using namespace WebCore;
namespace WebKit {
@@ -44,4 +48,16 @@
{
}
+PassRefPtr<ImmutableArray> WebOpenPanelParameters::acceptMIMETypes() const
+{
+ size_t size = m_settings.acceptMIMETypes.size();
+
+ Vector<RefPtr<APIObject> > vector;
+ vector.reserveInitialCapacity(size);
+
+ for (size_t i = 0; i < size; ++i)
+ vector.uncheckedAppend(WebString::create(m_settings.acceptMIMETypes[i]));
+ return ImmutableArray::adopt(vector);
+}
+
} // namespace WebCore
Modified: trunk/Source/WebKit2/Shared/WebOpenPanelParameters.h (99605 => 99606)
--- trunk/Source/WebKit2/Shared/WebOpenPanelParameters.h 2011-11-08 20:20:08 UTC (rev 99605)
+++ trunk/Source/WebKit2/Shared/WebOpenPanelParameters.h 2011-11-08 20:31:25 UTC (rev 99606)
@@ -33,6 +33,8 @@
namespace WebKit {
+class ImmutableArray;
+
class WebOpenPanelParameters : public APIObject {
public:
static const Type APIType = TypeOpenPanelParameters;
@@ -41,6 +43,7 @@
~WebOpenPanelParameters();
bool allowMultipleFiles() const { return m_settings.allowsMultipleFiles; }
+ PassRefPtr<ImmutableArray> acceptMIMETypes() const;
Vector<String> selectedFileNames() const { return m_settings.selectedFiles; }
private:
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp (99605 => 99606)
--- trunk/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp 2011-11-08 20:20:08 UTC (rev 99605)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp 2011-11-08 20:31:25 UTC (rev 99606)
@@ -26,6 +26,7 @@
#include "config.h"
#include "WKOpenPanelParameters.h"
+#include "ImmutableArray.h"
#include "WKAPICast.h"
#include "WebOpenPanelParameters.h"
@@ -40,3 +41,8 @@
{
return toImpl(parametersRef)->allowMultipleFiles();
}
+
+WKArrayRef WKOpenPanelParametersCopyAcceptedMIMETypes(WKOpenPanelParametersRef parametersRef)
+{
+ return toAPI(toImpl(parametersRef)->acceptMIMETypes().leakRef());
+}
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h (99605 => 99606)
--- trunk/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h 2011-11-08 20:20:08 UTC (rev 99605)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h 2011-11-08 20:31:25 UTC (rev 99606)
@@ -40,6 +40,8 @@
WK_EXPORT bool WKOpenPanelParametersGetAllowsMultipleFiles(WKOpenPanelParametersRef parameters);
+WK_EXPORT WKArrayRef WKOpenPanelParametersCopyAcceptedMIMETypes(WKOpenPanelParametersRef parameters);
+
#ifdef __cplusplus
}
#endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes