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

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: Oops, adding tests killed by the previous patch set. 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 // 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
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_
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_render_view_observer.cc ('k') | chrome/renderer/content_settings_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698