OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/extension_management.h" | 5 #include "chrome/browser/extensions/extension_management.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 LoadPreference(pref_names::kExtensionManagement, | 266 LoadPreference(pref_names::kExtensionManagement, |
267 true, | 267 true, |
268 base::Value::Type::DICTIONARY)); | 268 base::Value::Type::DICTIONARY)); |
269 | 269 |
270 // Reset all settings. | 270 // Reset all settings. |
271 global_settings_.reset(new internal::GlobalSettings()); | 271 global_settings_.reset(new internal::GlobalSettings()); |
272 settings_by_id_.clear(); | 272 settings_by_id_.clear(); |
273 default_settings_.reset(new internal::IndividualSettings()); | 273 default_settings_.reset(new internal::IndividualSettings()); |
274 | 274 |
275 // Parse default settings. | 275 // Parse default settings. |
276 const base::StringValue wildcard("*"); | 276 const base::Value wildcard("*"); |
277 if (denied_list_pref && | 277 if (denied_list_pref && |
278 denied_list_pref->Find(wildcard) != denied_list_pref->end()) { | 278 denied_list_pref->Find(wildcard) != denied_list_pref->end()) { |
279 default_settings_->installation_mode = INSTALLATION_BLOCKED; | 279 default_settings_->installation_mode = INSTALLATION_BLOCKED; |
280 } | 280 } |
281 | 281 |
282 const base::DictionaryValue* subdict = NULL; | 282 const base::DictionaryValue* subdict = NULL; |
283 if (dict_pref && | 283 if (dict_pref && |
284 dict_pref->GetDictionary(schema_constants::kWildcard, &subdict)) { | 284 dict_pref->GetDictionary(schema_constants::kWildcard, &subdict)) { |
285 if (!default_settings_->Parse( | 285 if (!default_settings_->Parse( |
286 subdict, internal::IndividualSettings::SCOPE_DEFAULT)) { | 286 subdict, internal::IndividualSettings::SCOPE_DEFAULT)) { |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 content::BrowserContext* context) const { | 492 content::BrowserContext* context) const { |
493 return chrome::GetBrowserContextRedirectedInIncognito(context); | 493 return chrome::GetBrowserContextRedirectedInIncognito(context); |
494 } | 494 } |
495 | 495 |
496 void ExtensionManagementFactory::RegisterProfilePrefs( | 496 void ExtensionManagementFactory::RegisterProfilePrefs( |
497 user_prefs::PrefRegistrySyncable* user_prefs) { | 497 user_prefs::PrefRegistrySyncable* user_prefs) { |
498 user_prefs->RegisterDictionaryPref(pref_names::kExtensionManagement); | 498 user_prefs->RegisterDictionaryPref(pref_names::kExtensionManagement); |
499 } | 499 } |
500 | 500 |
501 } // namespace extensions | 501 } // namespace extensions |
OLD | NEW |