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

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 78303005: ContentSettings API should not interact with <webview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small cleanup/refactor Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/content_settings_observer.cc
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index 4f0a4b253f05bdcb0d57d30bdfa061cb403af105..ab9c587c95b4e659257b13d7cf61004552ce7fc3 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -71,7 +71,6 @@ ContentSettingsObserver::ContentSettingsObserver(
content::RenderView* render_view)
: content::RenderViewObserver(render_view),
content::RenderViewObserverTracker<ContentSettingsObserver>(render_view),
- content_setting_rules_(NULL),
is_interstitial_page_(false),
npapi_plugins_blocked_(false) {
ClearBlockedContentSettings();
@@ -80,11 +79,6 @@ ContentSettingsObserver::ContentSettingsObserver(
ContentSettingsObserver::~ContentSettingsObserver() {
}
-void ContentSettingsObserver::SetContentSettingRules(
- const RendererContentSettingRules* content_setting_rules) {
- content_setting_rules_ = content_setting_rules;
-}
-
bool ContentSettingsObserver::IsPluginTemporarilyAllowed(
const std::string& identifier) {
// If the empty string is in here, it means all plug-ins are allowed.
@@ -113,6 +107,8 @@ bool ContentSettingsObserver::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ContentSettingsObserver, message)
IPC_MESSAGE_HANDLER(ChromeViewMsg_SetAsInterstitial, OnSetAsInterstitial)
+ IPC_MESSAGE_HANDLER(ChromeViewMsg_SetContentSettingRules,
+ OnSetContentSettingRules)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
if (handled)
@@ -321,6 +317,13 @@ void ContentSettingsObserver::OnSetAsInterstitial() {
is_interstitial_page_ = true;
}
+void ContentSettingsObserver::OnSetContentSettingRules(
+ const RendererContentSettingRules& rules) {
+ if (!content_setting_rules_)
+ content_setting_rules_.reset(new RendererContentSettingRules());
+ *content_setting_rules_ = rules;
+}
+
void ContentSettingsObserver::ClearBlockedContentSettings() {
for (size_t i = 0; i < arraysize(content_blocked_); ++i)
content_blocked_[i] = false;

Powered by Google App Engine
This is Rietveld 408576698