Title: [118097] trunk/Source/WebKit/chromium
Revision
118097
Author
[email protected]
Date
2012-05-22 18:58:23 -0700 (Tue, 22 May 2012)

Log Message

[Chromium][API] Introduce WebPermissionClient::allowWebComponents()
https://bugs.webkit.org/show_bug.cgi?id=87097

Reviewed by Kent Tamura.

- Added WebPermissionClient::allowWebComponents(), and
- Implemented FrameLoaderClientImpl::shadowDOMAllowed() using it.

* public/WebPermissionClient.h:
(WebPermissionClient):
(WebKit::WebPermissionClient::allowWebComponents):
* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::shadowDOMAllowed):
(WebKit):
* src/FrameLoaderClientImpl.h:
(FrameLoaderClientImpl):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (118096 => 118097)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-23 01:53:08 UTC (rev 118096)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-23 01:58:23 UTC (rev 118097)
@@ -1,3 +1,22 @@
+2012-05-22  MORITA Hajime  <[email protected]>
+
+        [Chromium][API] Introduce WebPermissionClient::allowWebComponents()
+        https://bugs.webkit.org/show_bug.cgi?id=87097
+
+        Reviewed by Kent Tamura.
+
+        - Added WebPermissionClient::allowWebComponents(), and
+        - Implemented FrameLoaderClientImpl::shadowDOMAllowed() using it.
+
+        * public/WebPermissionClient.h:
+        (WebPermissionClient):
+        (WebKit::WebPermissionClient::allowWebComponents):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::shadowDOMAllowed):
+        (WebKit):
+        * src/FrameLoaderClientImpl.h:
+        (FrameLoaderClientImpl):
+
 2012-05-22  James Robinson  <[email protected]>
 
         Add a Setting to make position:fixed form a new stacking context

Modified: trunk/Source/WebKit/chromium/public/WebPermissionClient.h (118096 => 118097)


--- trunk/Source/WebKit/chromium/public/WebPermissionClient.h	2012-05-23 01:53:08 UTC (rev 118096)
+++ trunk/Source/WebKit/chromium/public/WebPermissionClient.h	2012-05-23 01:58:23 UTC (rev 118097)
@@ -89,6 +89,9 @@
     // Controls whether access to write the clipboard is allowed for this frame.
     virtual bool allowWriteToClipboard(WebFrame*, bool defaultValue) { return defaultValue; }
 
+    // Controls whether enabling Web Components API for this frame.
+    virtual bool allowWebComponents(WebFrame*, bool defaultValue) { return defaultValue; }
+
     // Notifies the client that the frame would have instantiated a plug-in if plug-ins were enabled.
     virtual void didNotAllowPlugins(WebFrame*) { }
 

Modified: trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp (118096 => 118097)


--- trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp	2012-05-23 01:53:08 UTC (rev 118096)
+++ trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp	2012-05-23 01:58:23 UTC (rev 118097)
@@ -239,6 +239,15 @@
     return enabledPerSettings;
 }
 
+bool FrameLoaderClientImpl::shadowDOMAllowed(bool enabledAsRuntimeFeature)
+{
+    WebViewImpl* webview = m_webFrame->viewImpl();
+    if (webview && webview->permissionClient())
+        return webview->permissionClient()->allowWebComponents(m_webFrame, enabledAsRuntimeFeature);
+
+    return enabledAsRuntimeFeature;
+}
+
 void FrameLoaderClientImpl::didNotAllowScript()
 {
     WebViewImpl* webview = m_webFrame->viewImpl();

Modified: trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h (118096 => 118097)


--- trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h	2012-05-23 01:53:08 UTC (rev 118096)
+++ trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h	2012-05-23 01:58:23 UTC (rev 118097)
@@ -199,6 +199,7 @@
     virtual bool allowImage(bool enabledPerSettings, const WebCore::KURL& imageURL);
     virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, WebCore::SecurityOrigin*, const WebCore::KURL&);
     virtual bool allowRunningInsecureContent(bool enabledPerSettings, WebCore::SecurityOrigin*, const WebCore::KURL&);
+    virtual bool shadowDOMAllowed(bool enabledAsRuntimeFeature) OVERRIDE;
     virtual void didNotAllowScript();
     virtual void didNotAllowPlugins();
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to