diff options
Diffstat (limited to 'chromium/third_party/WebKit/public/web/WebPermissionClient.h')
-rw-r--r-- | chromium/third_party/WebKit/public/web/WebPermissionClient.h | 58 |
1 files changed, 25 insertions, 33 deletions
diff --git a/chromium/third_party/WebKit/public/web/WebPermissionClient.h b/chromium/third_party/WebKit/public/web/WebPermissionClient.h index 1fe2ad1976a..b1e9f58c7ef 100644 --- a/chromium/third_party/WebKit/public/web/WebPermissionClient.h +++ b/chromium/third_party/WebKit/public/web/WebPermissionClient.h @@ -31,12 +31,11 @@ #ifndef WebPermissionClient_h #define WebPermissionClient_h -#define WEBPERMISSIONCLIENT_USES_FRAME_FOR_ALL_METHODS +#include "public/platform/WebPermissionCallbacks.h" namespace blink { class WebDocument; -class WebFrame; class WebSecurityOrigin; class WebString; class WebURL; @@ -44,80 +43,73 @@ class WebURL; class WebPermissionClient { public: // Controls whether access to Web Databases is allowed for this frame. - virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) { return true; } + virtual bool allowDatabase(const WebString& name, const WebString& displayName, unsigned long estimatedSize) { return true; } // Controls whether access to File System is allowed for this frame. - virtual bool allowFileSystem(WebFrame*) { return true; } + virtual bool requestFileSystemAccessSync() { return true; } + + // Controls whether access to File System is allowed for this frame. + virtual void requestFileSystemAccessAsync(const WebPermissionCallbacks& callbacks) { WebPermissionCallbacks permissionCallbacks(callbacks); permissionCallbacks.doAllow(); } // Controls whether images are allowed for this frame. - virtual bool allowImage(WebFrame* frame, bool enabledPerSettings, const WebURL& imageURL) { return enabledPerSettings; } + virtual bool allowImage(bool enabledPerSettings, const WebURL& imageURL) { return enabledPerSettings; } // Controls whether access to Indexed DB are allowed for this frame. - virtual bool allowIndexedDB(WebFrame*, const WebString& name, const WebSecurityOrigin&) { return true; } + virtual bool allowIndexedDB(const WebString& name, const WebSecurityOrigin&) { return true; } // Controls whether plugins are allowed for this frame. - virtual bool allowPlugins(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; } + virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettings; } // Controls whether scripts are allowed to execute for this frame. - virtual bool allowScript(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; } + virtual bool allowScript(bool enabledPerSettings) { return enabledPerSettings; } // Controls whether scripts loaded from the given URL are allowed to execute for this frame. - virtual bool allowScriptFromSource(WebFrame*, bool enabledPerSettings, const WebURL& scriptURL) { return enabledPerSettings; } + virtual bool allowScriptFromSource(bool enabledPerSettings, const WebURL& scriptURL) { return enabledPerSettings; } // Controls whether insecrure content is allowed to display for this frame. - virtual bool allowDisplayingInsecureContent(WebFrame*, bool enabledPerSettings, const WebSecurityOrigin&, const WebURL&) { return enabledPerSettings; } + virtual bool allowDisplayingInsecureContent(bool enabledPerSettings, const WebSecurityOrigin&, const WebURL&) { return enabledPerSettings; } // Controls whether insecrure scripts are allowed to execute for this frame. - virtual bool allowRunningInsecureContent(WebFrame*, bool enabledPerSettings, const WebSecurityOrigin&, const WebURL&) { return enabledPerSettings; } + virtual bool allowRunningInsecureContent(bool enabledPerSettings, const WebSecurityOrigin&, const WebURL&) { return enabledPerSettings; } // Controls whether the given script extension should run in a new script // context in this frame. If extensionGroup is 0, the script context is the // frame's main context. Otherwise, it is a context created by - // WebFrame::executeScriptInIsolatedWorld with that same extensionGroup + // WebLocalFrame::executeScriptInIsolatedWorld with that same extensionGroup // value. - virtual bool allowScriptExtension(WebFrame*, const WebString& extensionName, int extensionGroup) { return true; } + virtual bool allowScriptExtension(const WebString& extensionName, int extensionGroup) { return true; } - virtual bool allowScriptExtension(WebFrame* webFrame, const WebString& extensionName, int extensionGroup, int worldId) + virtual bool allowScriptExtension(const WebString& extensionName, int extensionGroup, int worldId) { - return allowScriptExtension(webFrame, extensionName, extensionGroup); + return allowScriptExtension(extensionName, extensionGroup); } // Controls whether HTML5 Web Storage is allowed for this frame. // If local is true, then this is for local storage, otherwise it's for session storage. - virtual bool allowStorage(WebFrame*, bool local) { return true; } + virtual bool allowStorage(bool local) { return true; } // Controls whether access to read the clipboard is allowed for this frame. - virtual bool allowReadFromClipboard(WebFrame*, bool defaultValue) { return defaultValue; } + virtual bool allowReadFromClipboard(bool defaultValue) { return defaultValue; } // Controls whether access to write the clipboard is allowed for this frame. - virtual bool allowWriteToClipboard(WebFrame*, bool defaultValue) { return defaultValue; } + virtual bool allowWriteToClipboard(bool defaultValue) { return defaultValue; } -#if defined(WEBPERMISSIONCLIENT_USES_FRAME_FOR_ALL_METHODS) // Controls whether enabling Web Components API for this frame. - virtual bool allowWebComponents(WebFrame*, bool defaultValue) { return defaultValue; } + virtual bool allowWebComponents(bool defaultValue) { return defaultValue; } // Controls whether to enable MutationEvents for this frame. // The common use case of this method is actually to selectively disable MutationEvents, // but it's been named for consistency with the rest of the interface. - virtual bool allowMutationEvents(WebFrame*, bool defaultValue) { return defaultValue; } + virtual bool allowMutationEvents(bool defaultValue) { return defaultValue; } // Controls whether pushState and related History APIs are enabled for this frame. - virtual bool allowPushState(WebFrame*) { return true; } -#else - // These methods are deprecated and will be removed after Chrome uses the new versions above. - virtual bool allowWebComponents(const WebDocument&, bool defaultValue) { return defaultValue; } - virtual bool allowMutationEvents(const WebDocument&, bool defaultValue) { return defaultValue; } - virtual bool allowPushState(const WebDocument&) { return true; } -#endif - - // Controls whether WebGL extension WEBGL_debug_renderer_info is allowed for this frame. - virtual bool allowWebGLDebugRendererInfo(WebFrame*) { return false; } + virtual bool allowPushState() { return true; } // Notifies the client that the frame would have instantiated a plug-in if plug-ins were enabled. - virtual void didNotAllowPlugins(WebFrame*) { } + virtual void didNotAllowPlugins() { } // Notifies the client that the frame would have executed script if script were enabled. - virtual void didNotAllowScript(WebFrame*) { } + virtual void didNotAllowScript() { } protected: ~WebPermissionClient() { } |