Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(797)

Side by Side Diff: chrome/renderer/content_settings_observer.h

Issue 8773035: Content settings: allow scripts on interstitial pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 // Make all |AllowScript| and |AllowScriptFromSource| calls return true. Used
69 // for e.g., interstitial pages.
70 void AllowAllScripts();
71
68 private: 72 private:
69 // RenderViewObserver implementation. 73 // RenderViewObserver implementation.
70 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 74 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
71 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame, 75 virtual void DidCommitProvisionalLoad(WebKit::WebFrame* frame,
72 bool is_new_navigation) OVERRIDE; 76 bool is_new_navigation) OVERRIDE;
73 77
74 // Message handlers. 78 // Message handlers.
75 void OnLoadBlockedPlugins(); 79 void OnLoadBlockedPlugins();
76 80
77 // Resets the |content_blocked_| array. 81 // Resets the |content_blocked_| array.
78 void ClearBlockedContentSettings(); 82 void ClearBlockedContentSettings();
79 83
80 // A pointer to content setting rules stored by the renderer. Normally, the 84 // A pointer to content setting rules stored by the renderer. Normally, the
81 // |RendererContentSettingRules| object is owned by 85 // |RendererContentSettingRules| object is owned by
82 // |ChromeRenderProcessObserver|. In the tests it is owned by the caller of 86 // |ChromeRenderProcessObserver|. In the tests it is owned by the caller of
83 // |SetContentSettingRules|. 87 // |SetContentSettingRules|.
84 const RendererContentSettingRules* content_setting_rules_; 88 const RendererContentSettingRules* content_setting_rules_;
85 89
86 // Stores if images, scripts, and plugins have actually been blocked. 90 // Stores if images, scripts, and plugins have actually been blocked.
87 bool content_blocked_[CONTENT_SETTINGS_NUM_TYPES]; 91 bool content_blocked_[CONTENT_SETTINGS_NUM_TYPES];
88 92
89 // Caches the result of AllowStorage. 93 // Caches the result of AllowStorage.
90 typedef std::pair<GURL, bool> StoragePermissionsKey; 94 typedef std::pair<GURL, bool> StoragePermissionsKey;
91 std::map<StoragePermissionsKey, bool> cached_storage_permissions_; 95 std::map<StoragePermissionsKey, bool> cached_storage_permissions_;
92 96
93 // Caches the result of |AllowScript|. 97 // Caches the result of |AllowScript|.
94 std::map<WebKit::WebFrame*, bool> cached_script_permissions_; 98 std::map<WebKit::WebFrame*, bool> cached_script_permissions_;
95 99
96 bool plugins_temporarily_allowed_; 100 bool plugins_temporarily_allowed_;
101 bool all_scripts_allowed_;
97 102
98 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver); 103 DISALLOW_COPY_AND_ASSIGN(ContentSettingsObserver);
99 }; 104 };
100 105
101 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_ 106 #endif // CHROME_RENDERER_CONTENT_SETTINGS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698