| OLD | NEW |
| 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/extensions/extension_prefs.h" | 5 #include "chrome/browser/extensions/extension_prefs.h" |
| 6 | 6 |
| 7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/admin_policy.h" | 10 #include "chrome/browser/extensions/admin_policy.h" |
| (...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 return ReadExtensionPrefBoolean(extension_id, kPrefAppNotificationDisbaled); | 646 return ReadExtensionPrefBoolean(extension_id, kPrefAppNotificationDisbaled); |
| 647 } | 647 } |
| 648 | 648 |
| 649 void ExtensionPrefs::SetAppNotificationDisabled( | 649 void ExtensionPrefs::SetAppNotificationDisabled( |
| 650 const std::string& extension_id, bool value) { | 650 const std::string& extension_id, bool value) { |
| 651 DCHECK(Extension::IdIsValid(extension_id)); | 651 DCHECK(Extension::IdIsValid(extension_id)); |
| 652 UpdateExtensionPref(extension_id, kPrefAppNotificationDisbaled, | 652 UpdateExtensionPref(extension_id, kPrefAppNotificationDisbaled, |
| 653 Value::CreateBooleanValue(value)); | 653 Value::CreateBooleanValue(value)); |
| 654 } | 654 } |
| 655 | 655 |
| 656 std::string ExtensionPrefs::GetPolicyProviderName() const { | 656 std::string ExtensionPrefs::GetDebugPolicyProviderName() const { |
| 657 #ifdef NDEBUG |
| 658 NOTREACHED(); |
| 659 return std::string(); |
| 660 #else |
| 657 return "admin policy black/white/forcelist, via the ExtensionPrefs"; | 661 return "admin policy black/white/forcelist, via the ExtensionPrefs"; |
| 662 #endif |
| 658 } | 663 } |
| 659 | 664 |
| 660 bool ExtensionPrefs::UserMayLoad(const extensions::Extension* extension, | 665 bool ExtensionPrefs::UserMayLoad(const extensions::Extension* extension, |
| 661 string16* error) const { | 666 string16* error) const { |
| 662 | 667 |
| 663 const base::ListValue* blacklist = | 668 const base::ListValue* blacklist = |
| 664 prefs_->GetList(prefs::kExtensionInstallDenyList); | 669 prefs_->GetList(prefs::kExtensionInstallDenyList); |
| 665 const base::ListValue* whitelist = | 670 const base::ListValue* whitelist = |
| 666 prefs_->GetList(prefs::kExtensionInstallAllowList); | 671 prefs_->GetList(prefs::kExtensionInstallAllowList); |
| 667 return extensions::admin_policy::UserMayLoad(blacklist, whitelist, extension, | 672 return extensions::admin_policy::UserMayLoad(blacklist, whitelist, extension, |
| (...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1879 PrefService::UNSYNCABLE_PREF); | 1884 PrefService::UNSYNCABLE_PREF); |
| 1880 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, | 1885 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, |
| 1881 0, // default value | 1886 0, // default value |
| 1882 PrefService::UNSYNCABLE_PREF); | 1887 PrefService::UNSYNCABLE_PREF); |
| 1883 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, | 1888 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, |
| 1884 0, // default value | 1889 0, // default value |
| 1885 PrefService::UNSYNCABLE_PREF); | 1890 PrefService::UNSYNCABLE_PREF); |
| 1886 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, | 1891 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, |
| 1887 PrefService::UNSYNCABLE_PREF); | 1892 PrefService::UNSYNCABLE_PREF); |
| 1888 } | 1893 } |
| OLD | NEW |