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