Index: chrome/renderer/content_settings_observer.h |
diff --git a/chrome/renderer/content_settings_observer.h b/chrome/renderer/content_settings_observer.h |
index c8190f0817d69b9dfd8e37e93d8d355304076eec..66429840af2a0a6cbbe0b5728c6f6c94b091112b 100644 |
--- a/chrome/renderer/content_settings_observer.h |
+++ b/chrome/renderer/content_settings_observer.h |
@@ -28,12 +28,6 @@ class ContentSettingsObserver |
explicit ContentSettingsObserver(content::RenderView* render_view); |
virtual ~ContentSettingsObserver(); |
- // Sets the content setting rules which back |AllowImage()|, |AllowScript()|, |
- // and |AllowScriptFromSource()|. |content_setting_rules| must outlive this |
- // |ContentSettingsObserver|. |
- void SetContentSettingRules( |
- const RendererContentSettingRules* content_setting_rules); |
- |
bool IsPluginTemporarilyAllowed(const std::string& identifier); |
// Sends an IPC notification that the specified content type was blocked. |
@@ -73,6 +67,16 @@ class ContentSettingsObserver |
private: |
FRIEND_TEST_ALL_PREFIXES(ContentSettingsObserverTest, WhitelistedSchemes); |
FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, |
+ ContentSettingsAllowScripts); |
+ FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, |
+ JSBlockSentAfterPageLoad); |
+ FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, |
+ ImagesBlockedByDefault); |
+ FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, |
+ ImagesAllowedByDefault); |
+ FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, |
+ ContentSettingsBlockScripts); |
+ FRIEND_TEST_ALL_PREFIXES(ChromeRenderViewTest, |
ContentSettingsInterstitialPages); |
// RenderViewObserver implementation. |
@@ -83,6 +87,7 @@ class ContentSettingsObserver |
// Message handlers. |
void OnLoadBlockedPlugins(const std::string& identifier); |
void OnSetAsInterstitial(); |
+ void OnSetContentSettingRules(const RendererContentSettingRules& rules); |
// Resets the |content_blocked_| array. |
void ClearBlockedContentSettings(); |
@@ -98,7 +103,7 @@ class ContentSettingsObserver |
// |RendererContentSettingRules| object is owned by |
// |ChromeRenderProcessObserver|. In the tests it is owned by the caller of |
// |SetContentSettingRules|. |
- const RendererContentSettingRules* content_setting_rules_; |
+ scoped_ptr<RendererContentSettingRules> content_setting_rules_; |
// Stores if images, scripts, and plugins have actually been blocked. |
bool content_blocked_[CONTENT_SETTINGS_NUM_TYPES]; |