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