| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ | 5 #ifndef CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ |
| 6 #define CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ | 6 #define CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 const RendererContentSettingRules* content_setting_rules); | 44 const RendererContentSettingRules* content_setting_rules); |
| 45 | 45 |
| 46 bool IsPluginTemporarilyAllowed(const std::string& identifier); | 46 bool IsPluginTemporarilyAllowed(const std::string& identifier); |
| 47 | 47 |
| 48 // Sends an IPC notification that the specified content type was blocked. | 48 // Sends an IPC notification that the specified content type was blocked. |
| 49 void DidBlockContentType(ContentSettingsType settings_type); | 49 void DidBlockContentType(ContentSettingsType settings_type); |
| 50 | 50 |
| 51 // blink::WebPermissionClient implementation. | 51 // blink::WebPermissionClient implementation. |
| 52 virtual bool allowDatabase(const blink::WebString& name, | 52 virtual bool allowDatabase(const blink::WebString& name, |
| 53 const blink::WebString& display_name, | 53 const blink::WebString& display_name, |
| 54 unsigned long estimated_size) OVERRIDE; | 54 unsigned long estimated_size) override; |
| 55 virtual void requestFileSystemAccessAsync( | 55 virtual void requestFileSystemAccessAsync( |
| 56 const blink::WebPermissionCallbacks& callbacks) OVERRIDE; | 56 const blink::WebPermissionCallbacks& callbacks) override; |
| 57 virtual bool allowImage(bool enabled_per_settings, | 57 virtual bool allowImage(bool enabled_per_settings, |
| 58 const blink::WebURL& image_url) OVERRIDE; | 58 const blink::WebURL& image_url) override; |
| 59 virtual bool allowIndexedDB(const blink::WebString& name, | 59 virtual bool allowIndexedDB(const blink::WebString& name, |
| 60 const blink::WebSecurityOrigin& origin) OVERRIDE; | 60 const blink::WebSecurityOrigin& origin) override; |
| 61 virtual bool allowPlugins(bool enabled_per_settings) OVERRIDE; | 61 virtual bool allowPlugins(bool enabled_per_settings) override; |
| 62 virtual bool allowScript(bool enabled_per_settings) OVERRIDE; | 62 virtual bool allowScript(bool enabled_per_settings) override; |
| 63 virtual bool allowScriptFromSource(bool enabled_per_settings, | 63 virtual bool allowScriptFromSource(bool enabled_per_settings, |
| 64 const blink::WebURL& script_url) OVERRIDE; | 64 const blink::WebURL& script_url) override; |
| 65 virtual bool allowStorage(bool local) OVERRIDE; | 65 virtual bool allowStorage(bool local) override; |
| 66 virtual bool allowReadFromClipboard(bool default_value) OVERRIDE; | 66 virtual bool allowReadFromClipboard(bool default_value) override; |
| 67 virtual bool allowWriteToClipboard(bool default_value) OVERRIDE; | 67 virtual bool allowWriteToClipboard(bool default_value) override; |
| 68 virtual bool allowMutationEvents(bool default_value) OVERRIDE; | 68 virtual bool allowMutationEvents(bool default_value) override; |
| 69 virtual bool allowPushState() OVERRIDE; | 69 virtual bool allowPushState() override; |
| 70 virtual void didNotAllowPlugins() OVERRIDE; | 70 virtual void didNotAllowPlugins() override; |
| 71 virtual void didNotAllowScript() OVERRIDE; | 71 virtual void didNotAllowScript() override; |
| 72 virtual bool allowDisplayingInsecureContent( | 72 virtual bool allowDisplayingInsecureContent( |
| 73 bool allowed_per_settings, | 73 bool allowed_per_settings, |
| 74 const blink::WebSecurityOrigin& context, | 74 const blink::WebSecurityOrigin& context, |
| 75 const blink::WebURL& url) OVERRIDE; | 75 const blink::WebURL& url) override; |
| 76 virtual bool allowRunningInsecureContent( | 76 virtual bool allowRunningInsecureContent( |
| 77 bool allowed_per_settings, | 77 bool allowed_per_settings, |
| 78 const blink::WebSecurityOrigin& context, | 78 const blink::WebSecurityOrigin& context, |
| 79 const blink::WebURL& url) OVERRIDE; | 79 const blink::WebURL& url) override; |
| 80 | 80 |
| 81 // This is used for cases when the NPAPI plugins malfunction if used. | 81 // This is used for cases when the NPAPI plugins malfunction if used. |
| 82 bool AreNPAPIPluginsBlocked() const; | 82 bool AreNPAPIPluginsBlocked() const; |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverTest, WhitelistedSchemes); | 85 FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverTest, WhitelistedSchemes); |
| 86 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, | 86 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, |
| 87 ContentSettingsInterstitialPages); | 87 ContentSettingsInterstitialPages); |
| 88 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, PluginsTemporarilyAllowed); | 88 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, PluginsTemporarilyAllowed); |
| 89 | 89 |
| 90 // RenderFrameObserver implementation. | 90 // RenderFrameObserver implementation. |
| 91 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 91 virtual bool OnMessageReceived(const IPC::Message& message) override; |
| 92 virtual void DidCommitProvisionalLoad(bool is_new_navigation) OVERRIDE; | 92 virtual void DidCommitProvisionalLoad(bool is_new_navigation) override; |
| 93 | 93 |
| 94 // Message handlers. | 94 // Message handlers. |
| 95 void OnLoadBlockedPlugins(const std::string& identifier); | 95 void OnLoadBlockedPlugins(const std::string& identifier); |
| 96 void OnSetAsInterstitial(); | 96 void OnSetAsInterstitial(); |
| 97 void OnNPAPINotSupported(); | 97 void OnNPAPINotSupported(); |
| 98 void OnSetAllowDisplayingInsecureContent(bool allow); | 98 void OnSetAllowDisplayingInsecureContent(bool allow); |
| 99 void OnSetAllowRunningInsecureContent(bool allow); | 99 void OnSetAllowRunningInsecureContent(bool allow); |
| 100 void OnReloadFrame(); | 100 void OnReloadFrame(); |
| 101 void OnRequestFileSystemAccessAsyncResponse(int request_id, bool allowed); | 101 void OnRequestFileSystemAccessAsyncResponse(int request_id, bool allowed); |
| 102 | 102 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 bool npapi_plugins_blocked_; | 150 bool npapi_plugins_blocked_; |
| 151 | 151 |
| 152 int current_request_id_; | 152 int current_request_id_; |
| 153 typedef std::map<int, blink::WebPermissionCallbacks> PermissionRequestMap; | 153 typedef std::map<int, blink::WebPermissionCallbacks> PermissionRequestMap; |
| 154 PermissionRequestMap permission_requests_; | 154 PermissionRequestMap permission_requests_; |
| 155 | 155 |
| 156 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); | 156 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ | 159 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ |
| OLD | NEW |