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

Side by Side Diff: chrome/browser/content_settings/host_content_settings_map.cc

Issue 18199003: Allow Chrome OS login profile to have different default pref values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/content_settings/host_content_settings_map.h" 5 #include "chrome/browser/content_settings/host_content_settings_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 #endif 131 #endif
132 132
133 OnContentSettingChanged(ContentSettingsPattern(), 133 OnContentSettingChanged(ContentSettingsPattern(),
134 ContentSettingsPattern(), 134 ContentSettingsPattern(),
135 CONTENT_SETTINGS_TYPE_DEFAULT, 135 CONTENT_SETTINGS_TYPE_DEFAULT,
136 std::string()); 136 std::string());
137 } 137 }
138 #endif 138 #endif
139 139
140 // static 140 // static
141 void HostContentSettingsMap::RegisterUserPrefs( 141 void HostContentSettingsMap::RegisterProfilePrefs(
142 user_prefs::PrefRegistrySyncable* registry) { 142 user_prefs::PrefRegistrySyncable* registry) {
143 registry->RegisterIntegerPref( 143 registry->RegisterIntegerPref(
144 prefs::kContentSettingsWindowLastTabIndex, 144 prefs::kContentSettingsWindowLastTabIndex,
145 0, 145 0,
146 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 146 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
147 registry->RegisterIntegerPref( 147 registry->RegisterIntegerPref(
148 prefs::kContentSettingsDefaultWhitelistVersion, 148 prefs::kContentSettingsDefaultWhitelistVersion,
149 0, 149 0,
150 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 150 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
151 registry->RegisterBooleanPref( 151 registry->RegisterBooleanPref(
152 prefs::kContentSettingsClearOnExitMigrated, 152 prefs::kContentSettingsClearOnExitMigrated,
153 false, 153 false,
154 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); 154 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
155 155
156 // Register the prefs for the content settings providers. 156 // Register the prefs for the content settings providers.
157 content_settings::DefaultProvider::RegisterUserPrefs(registry); 157 content_settings::DefaultProvider::RegisterProfilePrefs(registry);
158 content_settings::PrefProvider::RegisterUserPrefs(registry); 158 content_settings::PrefProvider::RegisterProfilePrefs(registry);
159 content_settings::PolicyProvider::RegisterUserPrefs(registry); 159 content_settings::PolicyProvider::RegisterProfilePrefs(registry);
160 } 160 }
161 161
162 ContentSetting HostContentSettingsMap::GetDefaultContentSettingFromProvider( 162 ContentSetting HostContentSettingsMap::GetDefaultContentSettingFromProvider(
163 ContentSettingsType content_type, 163 ContentSettingsType content_type,
164 content_settings::ProviderInterface* provider) const { 164 content_settings::ProviderInterface* provider) const {
165 scoped_ptr<content_settings::RuleIterator> rule_iterator( 165 scoped_ptr<content_settings::RuleIterator> rule_iterator(
166 provider->GetRuleIterator(content_type, std::string(), false)); 166 provider->GetRuleIterator(content_type, std::string(), false));
167 167
168 ContentSettingsPattern wildcard = ContentSettingsPattern::Wildcard(); 168 ContentSettingsPattern wildcard = ContentSettingsPattern::Wildcard();
169 while (rule_iterator->HasNext()) { 169 while (rule_iterator->HasNext()) {
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 HostContentSettingsMap::GetProviderTypeFromSource( 602 HostContentSettingsMap::GetProviderTypeFromSource(
603 const std::string& source) { 603 const std::string& source) {
604 for (size_t i = 0; i < arraysize(kProviderNames); ++i) { 604 for (size_t i = 0; i < arraysize(kProviderNames); ++i) {
605 if (source == kProviderNames[i]) 605 if (source == kProviderNames[i])
606 return static_cast<ProviderType>(i); 606 return static_cast<ProviderType>(i);
607 } 607 }
608 608
609 NOTREACHED(); 609 NOTREACHED();
610 return DEFAULT_PROVIDER; 610 return DEFAULT_PROVIDER;
611 } 611 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698