Diff
Modified: trunk/Source/WebKit/blackberry/Api/WebPageClient.h (122831 => 122832)
--- trunk/Source/WebKit/blackberry/Api/WebPageClient.h 2012-07-17 09:59:36 UTC (rev 122831)
+++ trunk/Source/WebKit/blackberry/Api/WebPageClient.h 2012-07-17 10:23:27 UTC (rev 122832)
@@ -259,6 +259,16 @@
virtual bool hasKeyboardFocus() = 0;
virtual bool createPopupWebView(const Platform::IntRect&) = 0;
virtual void closePopupWebView() = 0;
+
+ // Match with ChromeClient::CustomHandlersState.
+ enum ProtocolHandlersState {
+ ProtocolHandlersNew,
+ ProtocolHandlersRegistered,
+ ProtocolHandlersDeclined
+ };
+ virtual void registerProtocolHandler(const WebString& /*scheme*/, const WebString& /*baseURL*/, const WebString& /*url*/, const WebString& /*title*/) = 0;
+ virtual ProtocolHandlersState isProtocolHandlerRegistered(const WebString& /*scheme*/, const WebString& /*baseURL*/, const WebString& /*url*/) = 0;
+ virtual void unregisterProtocolHandler(const WebString& /*scheme*/, const WebString& /*baseURL*/, const WebString& /*url*/) = 0;
};
} // namespace WebKit
} // namespace BlackBerry
Modified: trunk/Source/WebKit/blackberry/ChangeLog (122831 => 122832)
--- trunk/Source/WebKit/blackberry/ChangeLog 2012-07-17 09:59:36 UTC (rev 122831)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2012-07-17 10:23:27 UTC (rev 122832)
@@ -1,3 +1,25 @@
+2012-07-17 Chris Guan <[email protected]>
+
+ [BlackBerry] Enable registerProtocolHandler for Blackberry
+ https://bugs.webkit.org/show_bug.cgi?id=90422
+
+ Reviewed by George Staikos.
+
+ Implements APIs were added in Custom Scheme Handler specification
+ which is at http://dev.w3.org/html5/spec/Overview.html#custom-handlers.
+
+ Test cases:
+ fast/dom/register-protocol-handler.html
+ fast/dom/unregister-protocol-handler.html
+
+ * Api/WebPageClient.h:
+ * WebCoreSupport/ChromeClientBlackBerry.cpp:
+ (WebCore::ChromeClientBlackBerry::isProtocolHandlerRegistered):
+ (WebCore::ChromeClientBlackBerry::unregisterProtocolHandler):
+ (WebCore::ChromeClientBlackBerry::registerProtocolHandler):
+ * WebCoreSupport/ChromeClientBlackBerry.h:
+ (ChromeClientBlackBerry):
+
2012-07-16 Benjamin C Meyer <[email protected]>
Any webpage can crash webkit via qnx.callExtensionMethod assuming 'this' is the 'qnx' object.
Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp (122831 => 122832)
--- trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp 2012-07-17 09:59:36 UTC (rev 122831)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp 2012-07-17 10:23:27 UTC (rev 122832)
@@ -817,19 +817,21 @@
}
#if ENABLE(CUSTOM_SCHEME_HANDLER)
-ChromeClient::CustomHandlersState ChromeClientBlackBerry::isProtocolHandlerRegistered(const String&, const String&, const String&)
+ChromeClient::CustomHandlersState ChromeClientBlackBerry::isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url)
{
- return ChromeClient::CustomHandlersDeclined;
+ return static_cast<CustomHandlersState>(m_webPagePrivate->m_client->isProtocolHandlerRegistered(scheme, baseURL, url));
}
-void ChromeClientBlackBerry::unregisterProtocolHandler(const String&, const String&, const String&)
+void ChromeClientBlackBerry::unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url)
{
+ m_webPagePrivate->m_client->unregisterProtocolHandler(scheme, baseURL, url);
}
#endif
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
-void ChromeClientBlackBerry::registerProtocolHandler(const WTF::String&, const WTF::String&, const WTF::String&, const WTF::String&)
+void ChromeClientBlackBerry::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
{
+ m_webPagePrivate->m_client->registerProtocolHandler(scheme, baseURL, url, title);
}
#endif
Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h (122831 => 122832)
--- trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h 2012-07-17 09:59:36 UTC (rev 122831)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h 2012-07-17 10:23:27 UTC (rev 122832)
@@ -156,12 +156,12 @@
#endif
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
- virtual void registerProtocolHandler(const WTF::String&, const WTF::String&, const WTF::String&, const WTF::String&);
+ virtual void registerProtocolHandler(const String& /*scheme*/, const String& /*baseURL*/, const String& /*url*/, const String& /*title*/);
#endif
#if ENABLE(CUSTOM_SCHEME_HANDLER)
- virtual CustomHandlersState isProtocolHandlerRegistered(const String&, const String&, const String&);
- virtual void unregisterProtocolHandler(const String&, const String&, const String&);
+ virtual CustomHandlersState isProtocolHandlerRegistered(const String& /*scheme*/, const String& /*baseURL*/, const String& /*url*/);
+ virtual void unregisterProtocolHandler(const String& /*scheme*/, const String& /*baseURL*/, const String& /*url*/);
#endif
BlackBerry::WebKit::WebPagePrivate* webPagePrivate() const { return m_webPagePrivate; }