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 |
11 #include "chrome/common/content_settings.h" | 11 #include "chrome/common/content_settings.h" |
12 #include "content/public/renderer/render_frame_observer.h" | 12 #include "content/public/renderer/render_frame_observer.h" |
13 #include "content/public/renderer/render_frame_observer_tracker.h" | 13 #include "content/public/renderer/render_frame_observer_tracker.h" |
14 #include "extensions/common/permissions/api_permission.h" | 14 #include "extensions/common/permissions/api_permission.h" |
| 15 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
15 #include "third_party/WebKit/public/web/WebPermissionClient.h" | 16 #include "third_party/WebKit/public/web/WebPermissionClient.h" |
16 | 17 |
17 class GURL; | 18 class GURL; |
18 | 19 |
19 namespace blink { | 20 namespace blink { |
20 class WebFrame; | 21 class WebFrame; |
21 class WebSecurityOrigin; | 22 class WebSecurityOrigin; |
22 class WebURL; | 23 class WebURL; |
23 } | 24 } |
24 | 25 |
(...skipping 18 matching lines...) Expand all Loading... |
43 void SetContentSettingRules( | 44 void SetContentSettingRules( |
44 const RendererContentSettingRules* content_setting_rules); | 45 const RendererContentSettingRules* content_setting_rules); |
45 | 46 |
46 bool IsPluginTemporarilyAllowed(const std::string& identifier); | 47 bool IsPluginTemporarilyAllowed(const std::string& identifier); |
47 | 48 |
48 // Sends an IPC notification that the specified content type was blocked. | 49 // Sends an IPC notification that the specified content type was blocked. |
49 void DidBlockContentType(ContentSettingsType settings_type); | 50 void DidBlockContentType(ContentSettingsType settings_type); |
50 | 51 |
51 // blink::WebPermissionClient implementation. | 52 // blink::WebPermissionClient implementation. |
52 // TODO(jam): remove all these methods after Blink rolls. | 53 // TODO(jam): remove all these methods after Blink rolls. |
53 virtual bool allowDatabase(blink::WebFrame* frame, | 54 virtual bool allowDatabase(blink::WebLocalFrame* frame, |
54 const blink::WebString& name, | 55 const blink::WebString& name, |
55 const blink::WebString& display_name, | 56 const blink::WebString& display_name, |
56 unsigned long estimated_size); | 57 unsigned long estimated_size); |
57 virtual bool allowFileSystem(blink::WebFrame* frame); | 58 virtual bool allowFileSystem(blink::WebLocalFrame* frame); |
58 virtual bool allowImage(blink::WebFrame* frame, | 59 virtual bool allowImage(blink::WebLocalFrame* frame, |
59 bool enabled_per_settings, | 60 bool enabled_per_settings, |
60 const blink::WebURL& image_url); | 61 const blink::WebURL& image_url); |
61 virtual bool allowIndexedDB(blink::WebFrame* frame, | 62 virtual bool allowIndexedDB(blink::WebLocalFrame* frame, |
62 const blink::WebString& name, | 63 const blink::WebString& name, |
63 const blink::WebSecurityOrigin& origin); | 64 const blink::WebSecurityOrigin& origin); |
64 virtual bool allowPlugins(blink::WebFrame* frame, | 65 virtual bool allowPlugins(blink::WebLocalFrame* frame, |
65 bool enabled_per_settings); | 66 bool enabled_per_settings); |
66 virtual bool allowScript(blink::WebFrame* frame, | 67 virtual bool allowScript(blink::WebLocalFrame* frame, |
67 bool enabled_per_settings); | 68 bool enabled_per_settings); |
68 virtual bool allowScriptFromSource(blink::WebFrame* frame, | 69 virtual bool allowScriptFromSource(blink::WebLocalFrame* frame, |
69 bool enabled_per_settings, | 70 bool enabled_per_settings, |
70 const blink::WebURL& script_url); | 71 const blink::WebURL& script_url); |
71 virtual bool allowStorage(blink::WebFrame* frame, bool local); | 72 virtual bool allowStorage(blink::WebLocalFrame* frame, bool local); |
72 virtual bool allowReadFromClipboard(blink::WebFrame* frame, | 73 virtual bool allowReadFromClipboard(blink::WebLocalFrame* frame, |
73 bool default_value); | 74 bool default_value); |
74 virtual bool allowWriteToClipboard(blink::WebFrame* frame, | 75 virtual bool allowWriteToClipboard(blink::WebLocalFrame* frame, |
75 bool default_value); | 76 bool default_value); |
76 virtual bool allowWebComponents(blink::WebFrame* frame, bool); | 77 virtual bool allowWebComponents(blink::WebLocalFrame* frame, bool); |
77 virtual bool allowMutationEvents(blink::WebFrame* frame, | 78 virtual bool allowMutationEvents(blink::WebLocalFrame* frame, |
78 bool default_value); | 79 bool default_value); |
79 virtual bool allowPushState(blink::WebFrame* frame); | 80 virtual bool allowPushState(blink::WebLocalFrame* frame); |
80 virtual void didNotAllowPlugins(blink::WebFrame* frame); | 81 virtual void didNotAllowPlugins(blink::WebLocalFrame* frame); |
81 virtual void didNotAllowScript(blink::WebFrame* frame); | 82 virtual void didNotAllowScript(blink::WebLocalFrame* frame); |
82 virtual bool allowDisplayingInsecureContent( | 83 virtual bool allowDisplayingInsecureContent( |
83 blink::WebFrame* frame, | 84 blink::WebLocalFrame* frame, |
84 bool allowed_per_settings, | 85 bool allowed_per_settings, |
85 const blink::WebSecurityOrigin& context, | 86 const blink::WebSecurityOrigin& context, |
86 const blink::WebURL& url); | 87 const blink::WebURL& url); |
87 virtual bool allowRunningInsecureContent( | 88 virtual bool allowRunningInsecureContent( |
88 blink::WebFrame* frame, | 89 blink::WebLocalFrame* frame, |
89 bool allowed_per_settings, | 90 bool allowed_per_settings, |
90 const blink::WebSecurityOrigin& context, | 91 const blink::WebSecurityOrigin& context, |
91 const blink::WebURL& url); | 92 const blink::WebURL& url); |
92 | 93 |
93 virtual bool allowDatabase(const blink::WebString& name, | 94 virtual bool allowDatabase(const blink::WebString& name, |
94 const blink::WebString& display_name, | 95 const blink::WebString& display_name, |
95 unsigned long estimated_size); | 96 unsigned long estimated_size); |
96 virtual bool allowFileSystem(); | 97 virtual bool allowFileSystem(); |
97 virtual bool allowImage(bool enabled_per_settings, | 98 virtual bool allowImage(bool enabled_per_settings, |
98 const blink::WebURL& image_url); | 99 const blink::WebURL& image_url); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 std::map<blink::WebFrame*, bool> cached_script_permissions_; | 180 std::map<blink::WebFrame*, bool> cached_script_permissions_; |
180 | 181 |
181 std::set<std::string> temporarily_allowed_plugins_; | 182 std::set<std::string> temporarily_allowed_plugins_; |
182 bool is_interstitial_page_; | 183 bool is_interstitial_page_; |
183 bool npapi_plugins_blocked_; | 184 bool npapi_plugins_blocked_; |
184 | 185 |
185 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); | 186 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); |
186 }; | 187 }; |
187 | 188 |
188 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ | 189 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ |
OLD | NEW |