| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 // Controls whether images are allowed for this frame. | 27 // Controls whether images are allowed for this frame. |
| 28 virtual bool allowImage(bool enabledPerSettings, const WebURL& imageURL) { r
eturn enabledPerSettings; } | 28 virtual bool allowImage(bool enabledPerSettings, const WebURL& imageURL) { r
eturn enabledPerSettings; } |
| 29 | 29 |
| 30 // Controls whether access to Indexed DB are allowed for this frame. | 30 // Controls whether access to Indexed DB are allowed for this frame. |
| 31 virtual bool allowIndexedDB(const WebString& name, const WebSecurityOrigin&)
{ return true; } | 31 virtual bool allowIndexedDB(const WebString& name, const WebSecurityOrigin&)
{ return true; } |
| 32 | 32 |
| 33 // Controls whether HTML5 media elements (<audio>, <video>) are allowed for
this frame. | 33 // Controls whether HTML5 media elements (<audio>, <video>) are allowed for
this frame. |
| 34 virtual bool allowMedia(const WebURL& videoURL) { return true; } | 34 virtual bool allowMedia(const WebURL& videoURL) { return true; } |
| 35 | 35 |
| 36 // Controls whether keygen is allowed for this frame. |
| 37 virtual bool allowKeygen() { return false; } |
| 38 |
| 36 // Controls whether plugins are allowed for this frame. | 39 // Controls whether plugins are allowed for this frame. |
| 37 virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettin
gs; } | 40 virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettin
gs; } |
| 38 | 41 |
| 39 // Controls whether scripts are allowed to execute for this frame. | 42 // Controls whether scripts are allowed to execute for this frame. |
| 40 virtual bool allowScript(bool enabledPerSettings) { return enabledPerSetting
s; } | 43 virtual bool allowScript(bool enabledPerSettings) { return enabledPerSetting
s; } |
| 41 | 44 |
| 42 // Controls whether scripts loaded from the given URL are allowed to execute
for this frame. | 45 // Controls whether scripts loaded from the given URL are allowed to execute
for this frame. |
| 43 virtual bool allowScriptFromSource(bool enabledPerSettings, const WebURL& sc
riptURL) { return enabledPerSettings; } | 46 virtual bool allowScriptFromSource(bool enabledPerSettings, const WebURL& sc
riptURL) { return enabledPerSettings; } |
| 44 | 47 |
| 45 // Controls whether insecrure content is allowed to display for this frame. | 48 // Controls whether insecrure content is allowed to display for this frame. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 71 virtual bool allowWriteToClipboard(bool defaultValue) { return defaultValue;
} | 74 virtual bool allowWriteToClipboard(bool defaultValue) { return defaultValue;
} |
| 72 | 75 |
| 73 // Controls whether enabling Web Components API for this frame. | 76 // Controls whether enabling Web Components API for this frame. |
| 74 virtual bool allowWebComponents(bool defaultValue) { return defaultValue; } | 77 virtual bool allowWebComponents(bool defaultValue) { return defaultValue; } |
| 75 | 78 |
| 76 // Controls whether to enable MutationEvents for this frame. | 79 // Controls whether to enable MutationEvents for this frame. |
| 77 // The common use case of this method is actually to selectively disable Mut
ationEvents, | 80 // The common use case of this method is actually to selectively disable Mut
ationEvents, |
| 78 // but it's been named for consistency with the rest of the interface. | 81 // but it's been named for consistency with the rest of the interface. |
| 79 virtual bool allowMutationEvents(bool defaultValue) { return defaultValue; } | 82 virtual bool allowMutationEvents(bool defaultValue) { return defaultValue; } |
| 80 | 83 |
| 84 // Notifies the client that the frame would have instantiated a keygen if ke
ygen was enabled. |
| 85 virtual void didNotAllowKeygen() { } |
| 86 |
| 81 // Notifies the client that the frame would have instantiated a plugin if pl
ugins were enabled. | 87 // Notifies the client that the frame would have instantiated a plugin if pl
ugins were enabled. |
| 82 virtual void didNotAllowPlugins() { } | 88 virtual void didNotAllowPlugins() { } |
| 83 | 89 |
| 84 // Notifies the client that the frame would have executed script if script w
ere enabled. | 90 // Notifies the client that the frame would have executed script if script w
ere enabled. |
| 85 virtual void didNotAllowScript() { } | 91 virtual void didNotAllowScript() { } |
| 86 | 92 |
| 87 virtual ~WebContentSettingsClient() { } | 93 virtual ~WebContentSettingsClient() { } |
| 88 }; | 94 }; |
| 89 | 95 |
| 90 } // namespace blink | 96 } // namespace blink |
| 91 | 97 |
| 92 #endif // WebContentSettingsClient_h | 98 #endif // WebContentSettingsClient_h |
| OLD | NEW |