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

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

Issue 10537099: add "always allow" option to the mediastream infobar and allow user to allow/not allow acces to devi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check the exceptions before the default setting, sites in the exceptions list can access the device… Created 8 years, 6 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 d185dcddf73b178e5a3a794706c5a39e125fff24..6be39866aacb4a61f1fbddf59b9abfd363fd9c44 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider.cc
@@ -361,17 +361,39 @@ void PrefProvider::ReadContentSettingsFromPref(bool overwrite) {
}
}
}
- 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));
+ if (content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) {
Bernhard Bauer 2012/06/18 17:38:15 Hm. I think we should make the ContentTypeHasCompo
no longer working on chromium 2012/06/19 12:23:17 I make the ContentTypeHasCompoundValue() a static
Bernhard Bauer 2012/06/19 14:33:35 Right, but it's only unexpected to a client that u
+ // MediaStream is using compound type as value.
+ Value* value;
+ if (settings_dictionary->GetWithoutPathExpansion(
+ GetTypeName(ContentSettingsType(i)), &value)) {
+ if (value->IsType(Value::TYPE_DICTIONARY)) {
+ DictionaryValue* setting = NULL;
+ if (settings_dictionary->GetDictionaryWithoutPathExpansion(
+ GetTypeName(ContentSettingsType(i)), &setting)) {
+ DCHECK(!setting->empty());
+ value_map_.SetValue(pattern_pair.first,
+ pattern_pair.second,
+ content_type,
+ ResourceIdentifier(""),
+ setting->DeepCopy());
+ } else {
+ NOTREACHED();
+ }
+ }
+ }
+ } 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));
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698