| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const WebKit::WebString& name, | 58 const WebKit::WebString& name, |
| 59 const WebKit::WebSecurityOrigin& origin); | 59 const WebKit::WebSecurityOrigin& origin); |
| 60 bool AllowPlugins(WebKit::WebFrame* frame, bool enabled_per_settings); | 60 bool AllowPlugins(WebKit::WebFrame* frame, bool enabled_per_settings); |
| 61 bool AllowScript(WebKit::WebFrame* frame, bool enabled_per_settings); | 61 bool AllowScript(WebKit::WebFrame* frame, bool enabled_per_settings); |
| 62 bool AllowScriptFromSource(WebKit::WebFrame* frame, bool enabled_per_settings, | 62 bool AllowScriptFromSource(WebKit::WebFrame* frame, bool enabled_per_settings, |
| 63 const WebKit::WebURL& script_url); | 63 const WebKit::WebURL& script_url); |
| 64 bool AllowStorage(WebKit::WebFrame* frame, bool local); | 64 bool AllowStorage(WebKit::WebFrame* frame, bool local); |
| 65 void DidNotAllowPlugins(WebKit::WebFrame* frame); | 65 void DidNotAllowPlugins(WebKit::WebFrame* frame); |
| 66 void DidNotAllowScript(WebKit::WebFrame* frame); | 66 void DidNotAllowScript(WebKit::WebFrame* frame); |
| 67 | 67 |
| 68 // Used for allowing scripts and images on views displaying interstitial |
| 69 // pages. |
| 70 void SetAsInterstitial(); |
| 71 |
| 68 private: | 72 private: |
| 69 FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverTest, WhitelistedSchemes); | 73 FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverTest, WhitelistedSchemes); |
| 70 | 74 |
| 71 // RenderViewObserver implementation. | 75 // RenderViewObserver implementation. |
| 72 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 76 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 73 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, | 77 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, |
| 74 bool is_new_navigation) OVERRIDE; | 78 bool is_new_navigation) OVERRIDE; |
| 75 | 79 |
| 76 // Message handlers. | 80 // Message handlers. |
| 77 void OnLoadBlockedPlugins(); | 81 void OnLoadBlockedPlugins(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 96 bool content_blocked_[CONTENT_SETTINGS_NUM_TYPES]; | 100 bool content_blocked_[CONTENT_SETTINGS_NUM_TYPES]; |
| 97 | 101 |
| 98 // Caches the result of AllowStorage. | 102 // Caches the result of AllowStorage. |
| 99 typedef std::pair<GURL, bool> StoragePermissionsKey; | 103 typedef std::pair<GURL, bool> StoragePermissionsKey; |
| 100 std::map<StoragePermissionsKey, bool> cached_storage_permissions_; | 104 std::map<StoragePermissionsKey, bool> cached_storage_permissions_; |
| 101 | 105 |
| 102 // Caches the result of |AllowScript|. | 106 // Caches the result of |AllowScript|. |
| 103 std::map<WebKit::WebFrame*, bool> cached_script_permissions_; | 107 std::map<WebKit::WebFrame*, bool> cached_script_permissions_; |
| 104 | 108 |
| 105 bool plugins_temporarily_allowed_; | 109 bool plugins_temporarily_allowed_; |
| 110 bool is_interstitial_page_; |
| 106 | 111 |
| 107 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); | 112 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); |
| 108 }; | 113 }; |
| 109 | 114 |
| 110 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ | 115 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ |
| OLD | NEW |