| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WebContentSettingsClient_h | 5 #ifndef WebContentSettingsClient_h |
| 6 #define WebContentSettingsClient_h | 6 #define WebContentSettingsClient_h |
| 7 | 7 |
| 8 #include "public/platform/WebContentSettingCallbacks.h" | 8 #include "public/platform/WebContentSettingCallbacks.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Controls whether plugins are allowed for this frame. | 45 // Controls whether plugins are allowed for this frame. |
| 46 virtual bool allowPlugins(bool enabledPerSettings) { | 46 virtual bool allowPlugins(bool enabledPerSettings) { |
| 47 return enabledPerSettings; | 47 return enabledPerSettings; |
| 48 } | 48 } |
| 49 | 49 |
| 50 // Controls whether scripts are allowed to execute for this frame. | 50 // Controls whether scripts are allowed to execute for this frame. |
| 51 virtual bool allowScript(bool enabledPerSettings) { | 51 virtual bool allowScript(bool enabledPerSettings) { |
| 52 return enabledPerSettings; | 52 return enabledPerSettings; |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Controls whether scripts loaded from the given URL are allowed to execute f
or this frame. | 55 // Controls whether scripts loaded from the given URL are allowed to execute |
| 56 // for this frame. |
| 56 virtual bool allowScriptFromSource(bool enabledPerSettings, | 57 virtual bool allowScriptFromSource(bool enabledPerSettings, |
| 57 const WebURL& scriptURL) { | 58 const WebURL& scriptURL) { |
| 58 return enabledPerSettings; | 59 return enabledPerSettings; |
| 59 } | 60 } |
| 60 | 61 |
| 61 // Controls whether insecure scripts are allowed to execute for this frame. | 62 // Controls whether insecure scripts are allowed to execute for this frame. |
| 62 virtual bool allowRunningInsecureContent(bool enabledPerSettings, | 63 virtual bool allowRunningInsecureContent(bool enabledPerSettings, |
| 63 const WebSecurityOrigin&, | 64 const WebSecurityOrigin&, |
| 64 const WebURL&) { | 65 const WebURL&) { |
| 65 return enabledPerSettings; | 66 return enabledPerSettings; |
| 66 } | 67 } |
| 67 | 68 |
| 68 // Controls whether the given script extension should run in a new script | 69 // Controls whether the given script extension should run in a new script |
| 69 // context in this frame. If extensionGroup is 0, the script context is the | 70 // context in this frame. If extensionGroup is 0, the script context is the |
| 70 // frame's main context. Otherwise, it is a context created by | 71 // frame's main context. Otherwise, it is a context created by |
| 71 // WebLocalFrame::executeScriptInIsolatedWorld with that same extensionGroup | 72 // WebLocalFrame::executeScriptInIsolatedWorld with that same extensionGroup |
| 72 // value. | 73 // value. |
| 73 virtual bool allowScriptExtension(const WebString& extensionName, | 74 virtual bool allowScriptExtension(const WebString& extensionName, |
| 74 int extensionGroup) { | 75 int extensionGroup) { |
| 75 return true; | 76 return true; |
| 76 } | 77 } |
| 77 | 78 |
| 78 virtual bool allowScriptExtension(const WebString& extensionName, | 79 virtual bool allowScriptExtension(const WebString& extensionName, |
| 79 int extensionGroup, | 80 int extensionGroup, |
| 80 int worldId) { | 81 int worldId) { |
| 81 return allowScriptExtension(extensionName, extensionGroup); | 82 return allowScriptExtension(extensionName, extensionGroup); |
| 82 } | 83 } |
| 83 | 84 |
| 84 // Controls whether HTML5 Web Storage is allowed for this frame. | 85 // Controls whether HTML5 Web Storage is allowed for this frame. |
| 85 // If local is true, then this is for local storage, otherwise it's for sessio
n storage. | 86 // If local is true, then this is for local storage, otherwise it's for |
| 87 // session storage. |
| 86 virtual bool allowStorage(bool local) { return true; } | 88 virtual bool allowStorage(bool local) { return true; } |
| 87 | 89 |
| 88 // Controls whether access to read the clipboard is allowed for this frame. | 90 // Controls whether access to read the clipboard is allowed for this frame. |
| 89 virtual bool allowReadFromClipboard(bool defaultValue) { | 91 virtual bool allowReadFromClipboard(bool defaultValue) { |
| 90 return defaultValue; | 92 return defaultValue; |
| 91 } | 93 } |
| 92 | 94 |
| 93 // Controls whether access to write the clipboard is allowed for this frame. | 95 // Controls whether access to write the clipboard is allowed for this frame. |
| 94 virtual bool allowWriteToClipboard(bool defaultValue) { return defaultValue; } | 96 virtual bool allowWriteToClipboard(bool defaultValue) { return defaultValue; } |
| 95 | 97 |
| 96 // Controls whether enabling Web Components API for this frame. | 98 // Controls whether enabling Web Components API for this frame. |
| 97 virtual bool allowWebComponents(bool defaultValue) { return defaultValue; } | 99 virtual bool allowWebComponents(bool defaultValue) { return defaultValue; } |
| 98 | 100 |
| 99 // Controls whether to enable MutationEvents for this frame. | 101 // Controls whether to enable MutationEvents for this frame. |
| 100 // The common use case of this method is actually to selectively disable Mutat
ionEvents, | 102 // The common use case of this method is actually to selectively disable |
| 101 // but it's been named for consistency with the rest of the interface. | 103 // MutationEvents, but it's been named for consistency with the rest of the |
| 104 // interface. |
| 102 virtual bool allowMutationEvents(bool defaultValue) { return defaultValue; } | 105 virtual bool allowMutationEvents(bool defaultValue) { return defaultValue; } |
| 103 | 106 |
| 104 // Controls whether autoplay is allowed for this frame. | 107 // Controls whether autoplay is allowed for this frame. |
| 105 virtual bool allowAutoplay(bool defaultValue) { return defaultValue; } | 108 virtual bool allowAutoplay(bool defaultValue) { return defaultValue; } |
| 106 | 109 |
| 107 // Reports that passive mixed content was found at the provided URL. | 110 // Reports that passive mixed content was found at the provided URL. |
| 108 virtual void passiveInsecureContentFound(const WebURL&) {} | 111 virtual void passiveInsecureContentFound(const WebURL&) {} |
| 109 | 112 |
| 110 // Notifies the client that the frame would have instantiated a plugin if plug
ins were enabled. | 113 // Notifies the client that the frame would have instantiated a plugin if |
| 114 // plugins were enabled. |
| 111 virtual void didNotAllowPlugins() {} | 115 virtual void didNotAllowPlugins() {} |
| 112 | 116 |
| 113 // Notifies the client that the frame would have executed script if script wer
e enabled. | 117 // Notifies the client that the frame would have executed script if script |
| 118 // were enabled. |
| 114 virtual void didNotAllowScript() {} | 119 virtual void didNotAllowScript() {} |
| 115 | 120 |
| 116 // Notifies the client that the frame instantiated a keygen element. | 121 // Notifies the client that the frame instantiated a keygen element. |
| 117 virtual void didUseKeygen() {} | 122 virtual void didUseKeygen() {} |
| 118 | 123 |
| 119 virtual ~WebContentSettingsClient() {} | 124 virtual ~WebContentSettingsClient() {} |
| 120 }; | 125 }; |
| 121 | 126 |
| 122 } // namespace blink | 127 } // namespace blink |
| 123 | 128 |
| 124 #endif // WebContentSettingsClient_h | 129 #endif // WebContentSettingsClient_h |
| OLD | NEW |