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

Unified Diff: chrome/browser/content_settings/content_settings_pref_provider.cc

Issue 7088017: Split incognito extension content settings in session-only and persistent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 7 months 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/browser/content_settings/content_settings_pref_provider.cc
diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc
index 6fad7f4f5d53502165fbc90e665c81c58dab79ef..bcee6920dec9f3647a5dd14fe3aaa43c1893078d 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider.cc
@@ -133,10 +133,6 @@ void PrefDefaultProvider::UpdateDefaultSetting(
ContentSetting setting) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(kTypeNames[content_type] != NULL); // Don't call this for Geolocation.
- DCHECK(content_type != CONTENT_SETTINGS_TYPE_PLUGINS ||
- setting != CONTENT_SETTING_ASK ||
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableClickToPlay));
// The default settings may not be directly modified for OTR sessions.
// Instead, they are synced to the main profile's setting.
@@ -165,8 +161,9 @@ void PrefDefaultProvider::UpdateDefaultSetting(
}
updating_preferences_ = false;
- NotifyObservers(
- ContentSettingsDetails(ContentSettingsPattern(), content_type, ""));
+ ContentSettingsDetails details(
+ ContentSettingsPattern(), content_type, std::string());
+ NotifyObservers(details);
}
bool PrefDefaultProvider::DefaultSettingIsManaged(
@@ -207,8 +204,10 @@ void PrefDefaultProvider::Observe(NotificationType type,
}
if (!is_incognito_) {
- NotifyObservers(ContentSettingsDetails(
- ContentSettingsPattern(), CONTENT_SETTINGS_TYPE_DEFAULT, ""));
+ ContentSettingsDetails details(ContentSettingsPattern(),
+ CONTENT_SETTINGS_TYPE_DEFAULT,
+ std::string());
+ NotifyObservers(details);
}
} else if (type == NotificationType::PROFILE_DESTROYED) {
DCHECK_EQ(profile_, Source<Profile>(source).ptr());
@@ -497,7 +496,9 @@ void PrefProvider::SetContentSetting(
} // End scope of update.
updating_preferences_ = false;
- NotifyObservers(ContentSettingsDetails(requesting_pattern, content_type, ""));
+ ContentSettingsDetails details(
+ requesting_pattern, content_type, std::string());
+ NotifyObservers(details);
}
void PrefProvider::ResetToDefaults() {
@@ -568,8 +569,9 @@ void PrefProvider::ClearAllContentSettingsRules(
} // End scope of update.
updating_preferences_ = false;
- NotifyObservers(
- ContentSettingsDetails(ContentSettingsPattern(), content_type, ""));
+ ContentSettingsDetails details(
+ ContentSettingsPattern(), content_type, std::string());
+ NotifyObservers(details);
}
void PrefProvider::Observe(
@@ -592,9 +594,10 @@ void PrefProvider::Observe(
}
if (!is_incognito()) {
- NotifyObservers(ContentSettingsDetails(ContentSettingsPattern(),
- CONTENT_SETTINGS_TYPE_DEFAULT,
- ""));
+ ContentSettingsDetails details(ContentSettingsPattern(),
+ CONTENT_SETTINGS_TYPE_DEFAULT,
+ std::string());
+ NotifyObservers(details);
}
} else if (type == NotificationType::PROFILE_DESTROYED) {
DCHECK_EQ(profile_, Source<Profile>(source).ptr());

Powered by Google App Engine
This is Rietveld 408576698