| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool allowPlugins(bool enabled_per_settings) override; | 70 bool allowPlugins(bool enabled_per_settings) override; |
| 71 bool allowScript(bool enabled_per_settings) override; | 71 bool allowScript(bool enabled_per_settings) override; |
| 72 bool allowScriptFromSource(bool enabled_per_settings, | 72 bool allowScriptFromSource(bool enabled_per_settings, |
| 73 const blink::WebURL& script_url) override; | 73 const blink::WebURL& script_url) override; |
| 74 bool allowStorage(bool local) override; | 74 bool allowStorage(bool local) override; |
| 75 bool allowReadFromClipboard(bool default_value) override; | 75 bool allowReadFromClipboard(bool default_value) override; |
| 76 bool allowWriteToClipboard(bool default_value) override; | 76 bool allowWriteToClipboard(bool default_value) override; |
| 77 bool allowMutationEvents(bool default_value) override; | 77 bool allowMutationEvents(bool default_value) override; |
| 78 void didNotAllowPlugins() override; | 78 void didNotAllowPlugins() override; |
| 79 void didNotAllowScript() override; | 79 void didNotAllowScript() override; |
| 80 void usedKeygen() override; |
| 80 bool allowDisplayingInsecureContent(bool allowed_per_settings, | 81 bool allowDisplayingInsecureContent(bool allowed_per_settings, |
| 81 const blink::WebSecurityOrigin& context, | 82 const blink::WebSecurityOrigin& context, |
| 82 const blink::WebURL& url) override; | 83 const blink::WebURL& url) override; |
| 83 bool allowRunningInsecureContent(bool allowed_per_settings, | 84 bool allowRunningInsecureContent(bool allowed_per_settings, |
| 84 const blink::WebSecurityOrigin& context, | 85 const blink::WebSecurityOrigin& context, |
| 85 const blink::WebURL& url) override; | 86 const blink::WebURL& url) override; |
| 86 | 87 |
| 87 // This is used for cases when the NPAPI plugins malfunction if used. | 88 // This is used for cases when the NPAPI plugins malfunction if used. |
| 88 bool AreNPAPIPluginsBlocked() const; | 89 bool AreNPAPIPluginsBlocked() const; |
| 89 | 90 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // Insecure content may be permitted for the duration of this render view. | 137 // Insecure content may be permitted for the duration of this render view. |
| 137 bool allow_displaying_insecure_content_; | 138 bool allow_displaying_insecure_content_; |
| 138 bool allow_running_insecure_content_; | 139 bool allow_running_insecure_content_; |
| 139 | 140 |
| 140 // A pointer to content setting rules stored by the renderer. Normally, the | 141 // A pointer to content setting rules stored by the renderer. Normally, the |
| 141 // |RendererContentSettingRules| object is owned by | 142 // |RendererContentSettingRules| object is owned by |
| 142 // |ChromeRenderProcessObserver|. In the tests it is owned by the caller of | 143 // |ChromeRenderProcessObserver|. In the tests it is owned by the caller of |
| 143 // |SetContentSettingRules|. | 144 // |SetContentSettingRules|. |
| 144 const RendererContentSettingRules* content_setting_rules_; | 145 const RendererContentSettingRules* content_setting_rules_; |
| 145 | 146 |
| 146 // Stores if images, scripts, and plugins have actually been blocked. | 147 // Stores if images, scripts, keygen, and plugins have actually been blocked. |
| 147 std::map<ContentSettingsType, bool> content_blocked_; | 148 std::map<ContentSettingsType, bool> content_blocked_; |
| 148 | 149 |
| 149 // Caches the result of AllowStorage. | 150 // Caches the result of AllowStorage. |
| 150 typedef std::pair<GURL, bool> StoragePermissionsKey; | 151 typedef std::pair<GURL, bool> StoragePermissionsKey; |
| 151 std::map<StoragePermissionsKey, bool> cached_storage_permissions_; | 152 std::map<StoragePermissionsKey, bool> cached_storage_permissions_; |
| 152 | 153 |
| 153 // Caches the result of |AllowScript|. | 154 // Caches the result of AllowScript. |
| 154 std::map<blink::WebFrame*, bool> cached_script_permissions_; | 155 std::map<blink::WebFrame*, bool> cached_script_permissions_; |
| 155 | 156 |
| 156 std::set<std::string> temporarily_allowed_plugins_; | 157 std::set<std::string> temporarily_allowed_plugins_; |
| 157 bool is_interstitial_page_; | 158 bool is_interstitial_page_; |
| 158 bool npapi_plugins_blocked_; | 159 bool npapi_plugins_blocked_; |
| 159 | 160 |
| 160 int current_request_id_; | 161 int current_request_id_; |
| 161 typedef std::map<int, blink::WebContentSettingCallbacks> PermissionRequestMap; | 162 typedef std::map<int, blink::WebContentSettingCallbacks> PermissionRequestMap; |
| 162 PermissionRequestMap permission_requests_; | 163 PermissionRequestMap permission_requests_; |
| 163 | 164 |
| 164 // If true, IsWhitelistedForContentSettings will always return true. | 165 // If true, IsWhitelistedForContentSettings will always return true. |
| 165 const bool should_whitelist_; | 166 const bool should_whitelist_; |
| 166 | 167 |
| 167 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); | 168 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); |
| 168 }; | 169 }; |
| 169 | 170 |
| 170 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ | 171 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ |
| OLD | NEW |