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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); | 54 unsigned long estimated_size); |
55 virtual bool allowFileSystem(); | 55 virtual bool allowFileSystem(); |
| 56 virtual bool requestFileSystemAccessSync(); |
| 57 virtual void requestFileSystemAccessAsync( |
| 58 const blink::WebPermissionCallbacks& callbacks); |
56 virtual bool allowImage(bool enabled_per_settings, | 59 virtual bool allowImage(bool enabled_per_settings, |
57 const blink::WebURL& image_url); | 60 const blink::WebURL& image_url); |
58 virtual bool allowIndexedDB(const blink::WebString& name, | 61 virtual bool allowIndexedDB(const blink::WebString& name, |
59 const blink::WebSecurityOrigin& origin); | 62 const blink::WebSecurityOrigin& origin); |
60 virtual bool allowPlugins(bool enabled_per_settings); | 63 virtual bool allowPlugins(bool enabled_per_settings); |
61 virtual bool allowScript(bool enabled_per_settings); | 64 virtual bool allowScript(bool enabled_per_settings); |
62 virtual bool allowScriptFromSource(bool enabled_per_settings, | 65 virtual bool allowScriptFromSource(bool enabled_per_settings, |
63 const blink::WebURL& script_url); | 66 const blink::WebURL& script_url); |
64 virtual bool allowStorage(bool local); | 67 virtual bool allowStorage(bool local); |
65 virtual bool allowReadFromClipboard(bool default_value); | 68 virtual bool allowReadFromClipboard(bool default_value); |
(...skipping 25 matching lines...) Expand all Loading... |
91 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 94 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
92 virtual void DidCommitProvisionalLoad(bool is_new_navigation) OVERRIDE; | 95 virtual void DidCommitProvisionalLoad(bool is_new_navigation) OVERRIDE; |
93 | 96 |
94 // Message handlers. | 97 // Message handlers. |
95 void OnLoadBlockedPlugins(const std::string& identifier); | 98 void OnLoadBlockedPlugins(const std::string& identifier); |
96 void OnSetAsInterstitial(); | 99 void OnSetAsInterstitial(); |
97 void OnNPAPINotSupported(); | 100 void OnNPAPINotSupported(); |
98 void OnSetAllowDisplayingInsecureContent(bool allow); | 101 void OnSetAllowDisplayingInsecureContent(bool allow); |
99 void OnSetAllowRunningInsecureContent(bool allow); | 102 void OnSetAllowRunningInsecureContent(bool allow); |
100 void OnReloadFrame(); | 103 void OnReloadFrame(); |
| 104 void OnRequestFileSystemAccessAsyncResponse(int request_id, bool allowed); |
101 | 105 |
102 // Resets the |content_blocked_| array. | 106 // Resets the |content_blocked_| array. |
103 void ClearBlockedContentSettings(); | 107 void ClearBlockedContentSettings(); |
104 | 108 |
105 // If |origin| corresponds to an installed extension, returns that extension. | 109 // If |origin| corresponds to an installed extension, returns that extension. |
106 // Otherwise returns NULL. | 110 // Otherwise returns NULL. |
107 const extensions::Extension* GetExtension( | 111 const extensions::Extension* GetExtension( |
108 const blink::WebSecurityOrigin& origin) const; | 112 const blink::WebSecurityOrigin& origin) const; |
109 | 113 |
110 // Helpers. | 114 // Helpers. |
(...skipping 23 matching lines...) Expand all Loading... |
134 typedef std::pair<GURL, bool> StoragePermissionsKey; | 138 typedef std::pair<GURL, bool> StoragePermissionsKey; |
135 std::map<StoragePermissionsKey, bool> cached_storage_permissions_; | 139 std::map<StoragePermissionsKey, bool> cached_storage_permissions_; |
136 | 140 |
137 // Caches the result of |AllowScript|. | 141 // Caches the result of |AllowScript|. |
138 std::map<blink::WebFrame*, bool> cached_script_permissions_; | 142 std::map<blink::WebFrame*, bool> cached_script_permissions_; |
139 | 143 |
140 std::set<std::string> temporarily_allowed_plugins_; | 144 std::set<std::string> temporarily_allowed_plugins_; |
141 bool is_interstitial_page_; | 145 bool is_interstitial_page_; |
142 bool npapi_plugins_blocked_; | 146 bool npapi_plugins_blocked_; |
143 | 147 |
| 148 int current_request_id_; |
| 149 typedef std::map<int, blink::WebPermissionCallbacks> PermissionRequestMap; |
| 150 PermissionRequestMap permission_requests_; |
| 151 |
144 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); | 152 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); |
145 }; | 153 }; |
146 | 154 |
147 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ | 155 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ |
OLD | NEW |