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

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

Issue 9537014: Merge a bunch of CLs to whitelist the Google Talk plug-in when turning on click-to-play. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src
Patch Set: sync Created 8 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/content_settings/host_content_settings_map.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8b4cd7422fe5e7a0e2126dc8bd99cc6b6b2f06d8..09179c979d8ec11bdddae41d072b94978a7207d0 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider.cc
@@ -70,9 +70,7 @@ void ClearSettings(ContentSettingsType type,
// Otherwise, returns false.
bool GetResourceTypeName(ContentSettingsType content_type,
std::string* pref_key) {
- if (content_type == CONTENT_SETTINGS_TYPE_PLUGINS &&
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableResourceContentSettings)) {
+ if (content_type == CONTENT_SETTINGS_TYPE_PLUGINS) {
*pref_key = kPerPluginPrefName;
return true;
}
@@ -166,7 +164,8 @@ bool PrefProvider::SetWebsiteSetting(
// sites/origins defined by the |primary_pattern| and the |secondary_pattern|.
// Default settings are handled by the |DefaultProvider|.
if (primary_pattern == ContentSettingsPattern::Wildcard() &&
- secondary_pattern == ContentSettingsPattern::Wildcard()) {
+ secondary_pattern == ContentSettingsPattern::Wildcard() &&
+ resource_identifier.empty()) {
return false;
}
@@ -425,19 +424,18 @@ void PrefProvider::ReadContentSettingsFromPref(bool overwrite) {
Value::CreateIntegerValue(setting));
}
}
- } else {
- int setting = CONTENT_SETTING_DEFAULT;
- if (settings_dictionary->GetIntegerWithoutPathExpansion(
- GetTypeName(ContentSettingsType(i)), &setting)) {
- DCHECK_NE(CONTENT_SETTING_DEFAULT, setting);
- setting = FixObsoleteCookiePromptMode(content_type,
- ContentSetting(setting));
- value_map_.SetValue(pattern_pair.first,
- pattern_pair.second,
- content_type,
- ResourceIdentifier(""),
- Value::CreateIntegerValue(setting));
- }
+ }
+ int setting = CONTENT_SETTING_DEFAULT;
+ if (settings_dictionary->GetIntegerWithoutPathExpansion(
+ GetTypeName(ContentSettingsType(i)), &setting)) {
+ DCHECK_NE(CONTENT_SETTING_DEFAULT, setting);
+ setting = FixObsoleteCookiePromptMode(content_type,
+ ContentSetting(setting));
+ value_map_.SetValue(pattern_pair.first,
+ pattern_pair.second,
+ content_type,
+ ResourceIdentifier(""),
+ Value::CreateIntegerValue(setting));
}
}
}
@@ -471,7 +469,8 @@ void PrefProvider::UpdateObsoletePatternsPref(
if (settings_dictionary) {
std::string res_dictionary_path;
- if (GetResourceTypeName(content_type, &res_dictionary_path)) {
+ if (GetResourceTypeName(content_type, &res_dictionary_path) &&
+ !resource_identifier.empty()) {
DictionaryValue* resource_dictionary = NULL;
found = settings_dictionary->GetDictionary(
res_dictionary_path, &resource_dictionary);
@@ -503,11 +502,11 @@ void PrefProvider::UpdateObsoletePatternsPref(
settings_dictionary->SetWithoutPathExpansion(
setting_path, Value::CreateIntegerValue(setting));
}
- // Remove the settings dictionary if it is empty.
- if (settings_dictionary->empty()) {
- all_settings_dictionary->RemoveWithoutPathExpansion(
- pattern_str, NULL);
- }
+ }
+ // Remove the settings dictionary if it is empty.
+ if (settings_dictionary->empty()) {
+ all_settings_dictionary->RemoveWithoutPathExpansion(
+ pattern_str, NULL);
}
}
}
@@ -534,7 +533,8 @@ void PrefProvider::UpdatePatternPairsSettings(
if (settings_dictionary) {
std::string res_dictionary_path;
- if (GetResourceTypeName(content_type, &res_dictionary_path)) {
+ if (GetResourceTypeName(content_type, &res_dictionary_path) &&
+ !resource_identifier.empty()) {
DictionaryValue* resource_dictionary = NULL;
found = settings_dictionary->GetDictionary(
res_dictionary_path, &resource_dictionary);
« no previous file with comments | « no previous file | chrome/browser/content_settings/host_content_settings_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698