| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // allowPlugins(). | 31 // allowPlugins(). |
| 32 void SetContentSettings(const ContentSettings& settings); | 32 void SetContentSettings(const ContentSettings& settings); |
| 33 | 33 |
| 34 // Sets the default content settings that back allowScripts(), | 34 // Sets the default content settings that back allowScripts(), |
| 35 // allowImages(), and allowPlugins(). | 35 // allowImages(), and allowPlugins(). |
| 36 static void SetDefaultContentSettings(const ContentSettings& settings); | 36 static void SetDefaultContentSettings(const ContentSettings& settings); |
| 37 | 37 |
| 38 // Returns the setting for the given type. | 38 // Returns the setting for the given type. |
| 39 ContentSetting GetContentSetting(ContentSettingsType type); | 39 ContentSetting GetContentSetting(ContentSettingsType type); |
| 40 | 40 |
| 41 bool plugins_temporarily_allowed() { |
| 42 return plugins_temporarily_allowed_; |
| 43 } |
| 44 |
| 41 // Sends an IPC notification that the specified content type was blocked. | 45 // Sends an IPC notification that the specified content type was blocked. |
| 42 // If the content type requires it, |resource_identifier| names the specific | 46 // If the content type requires it, |resource_identifier| names the specific |
| 43 // resource that was blocked (the plugin path in the case of plugins), | 47 // resource that was blocked (the plugin path in the case of plugins), |
| 44 // otherwise it's the empty string. | 48 // otherwise it's the empty string. |
| 45 void DidBlockContentType(ContentSettingsType settings_type, | 49 void DidBlockContentType(ContentSettingsType settings_type, |
| 46 const std::string& resource_identifier); | 50 const std::string& resource_identifier); |
| 47 | 51 |
| 48 // These correspond to WebKit::WebPermissionClient methods. | 52 // These correspond to WebKit::WebPermissionClient methods. |
| 49 bool AllowDatabase(WebKit::WebFrame* frame, | 53 bool AllowDatabase(WebKit::WebFrame* frame, |
| 50 const WebKit::WebString& name, | 54 const WebKit::WebString& name, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // Caches the result of AllowStorage. | 101 // Caches the result of AllowStorage. |
| 98 typedef std::pair<GURL, bool> StoragePermissionsKey; | 102 typedef std::pair<GURL, bool> StoragePermissionsKey; |
| 99 std::map<StoragePermissionsKey, bool> cached_storage_permissions_; | 103 std::map<StoragePermissionsKey, bool> cached_storage_permissions_; |
| 100 | 104 |
| 101 bool plugins_temporarily_allowed_; | 105 bool plugins_temporarily_allowed_; |
| 102 | 106 |
| 103 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); | 107 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); |
| 104 }; | 108 }; |
| 105 | 109 |
| 106 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ | 110 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ |
| OLD | NEW |