| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 didUseKeygen() override; | 80 void didUseKeygen() override; |
| 81 bool allowDisplayingInsecureContent(bool allowed_per_settings, | |
| 82 const blink::WebURL& url) override; | |
| 83 bool allowRunningInsecureContent(bool allowed_per_settings, | 81 bool allowRunningInsecureContent(bool allowed_per_settings, |
| 84 const blink::WebSecurityOrigin& context, | 82 const blink::WebSecurityOrigin& context, |
| 85 const blink::WebURL& url) override; | 83 const blink::WebURL& url) override; |
| 86 bool allowAutoplay(bool default_value) override; | 84 bool allowAutoplay(bool default_value) override; |
| 85 void passiveInsecureContentFound(const blink::WebURL&) override; |
| 87 | 86 |
| 88 private: | 87 private: |
| 89 FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverTest, WhitelistedSchemes); | 88 FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverTest, WhitelistedSchemes); |
| 90 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, | 89 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, |
| 91 ContentSettingsInterstitialPages); | 90 ContentSettingsInterstitialPages); |
| 92 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, PluginsTemporarilyAllowed); | 91 FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, PluginsTemporarilyAllowed); |
| 93 | 92 |
| 94 // RenderFrameObserver implementation. | 93 // RenderFrameObserver implementation. |
| 95 bool OnMessageReceived(const IPC::Message& message) override; | 94 bool OnMessageReceived(const IPC::Message& message) override; |
| 96 void DidCommitProvisionalLoad(bool is_new_navigation, | 95 void DidCommitProvisionalLoad(bool is_new_navigation, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 124 static bool IsWhitelistedForContentSettings( | 123 static bool IsWhitelistedForContentSettings( |
| 125 const blink::WebSecurityOrigin& origin, | 124 const blink::WebSecurityOrigin& origin, |
| 126 const GURL& document_url); | 125 const GURL& document_url); |
| 127 | 126 |
| 128 #if defined(ENABLE_EXTENSIONS) | 127 #if defined(ENABLE_EXTENSIONS) |
| 129 // Owned by ChromeContentRendererClient and outlive us. | 128 // Owned by ChromeContentRendererClient and outlive us. |
| 130 extensions::Dispatcher* extension_dispatcher_; | 129 extensions::Dispatcher* extension_dispatcher_; |
| 131 #endif | 130 #endif |
| 132 | 131 |
| 133 // Insecure content may be permitted for the duration of this render view. | 132 // Insecure content may be permitted for the duration of this render view. |
| 134 bool allow_displaying_insecure_content_; | |
| 135 bool allow_running_insecure_content_; | 133 bool allow_running_insecure_content_; |
| 136 | 134 |
| 137 // A pointer to content setting rules stored by the renderer. Normally, the | 135 // A pointer to content setting rules stored by the renderer. Normally, the |
| 138 // |RendererContentSettingRules| object is owned by | 136 // |RendererContentSettingRules| object is owned by |
| 139 // |ChromeRenderThreadObserver|. In the tests it is owned by the caller of | 137 // |ChromeRenderThreadObserver|. In the tests it is owned by the caller of |
| 140 // |SetContentSettingRules|. | 138 // |SetContentSettingRules|. |
| 141 const RendererContentSettingRules* content_setting_rules_; | 139 const RendererContentSettingRules* content_setting_rules_; |
| 142 | 140 |
| 143 // Stores if images, scripts, and plugins have actually been blocked. | 141 // Stores if images, scripts, and plugins have actually been blocked. |
| 144 std::map<ContentSettingsType, bool> content_blocked_; | 142 std::map<ContentSettingsType, bool> content_blocked_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 157 typedef std::map<int, blink::WebContentSettingCallbacks> PermissionRequestMap; | 155 typedef std::map<int, blink::WebContentSettingCallbacks> PermissionRequestMap; |
| 158 PermissionRequestMap permission_requests_; | 156 PermissionRequestMap permission_requests_; |
| 159 | 157 |
| 160 // If true, IsWhitelistedForContentSettings will always return true. | 158 // If true, IsWhitelistedForContentSettings will always return true. |
| 161 const bool should_whitelist_; | 159 const bool should_whitelist_; |
| 162 | 160 |
| 163 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); | 161 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); |
| 164 }; | 162 }; |
| 165 | 163 |
| 166 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ | 164 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ |
| OLD | NEW |