| 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 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 << "Extension controlled preference key " << pref_key | 1799 << "Extension controlled preference key " << pref_key |
| 1800 << " not registered."; | 1800 << " not registered."; |
| 1801 | 1801 |
| 1802 return extension_pref_value_map_->CanExtensionControlPref(extension_id, | 1802 return extension_pref_value_map_->CanExtensionControlPref(extension_id, |
| 1803 pref_key, | 1803 pref_key, |
| 1804 incognito); | 1804 incognito); |
| 1805 } | 1805 } |
| 1806 | 1806 |
| 1807 bool ExtensionPrefs::DoesExtensionControlPref(const std::string& extension_id, | 1807 bool ExtensionPrefs::DoesExtensionControlPref(const std::string& extension_id, |
| 1808 const std::string& pref_key, | 1808 const std::string& pref_key, |
| 1809 bool incognito) { | 1809 bool* from_incognito) { |
| 1810 DCHECK(pref_service()->FindPreference(pref_key.c_str())) | 1810 DCHECK(pref_service()->FindPreference(pref_key.c_str())) |
| 1811 << "Extension controlled preference key " << pref_key | 1811 << "Extension controlled preference key " << pref_key |
| 1812 << " not registered."; | 1812 << " not registered."; |
| 1813 | 1813 |
| 1814 return extension_pref_value_map_->DoesExtensionControlPref(extension_id, | 1814 return extension_pref_value_map_->DoesExtensionControlPref(extension_id, |
| 1815 pref_key, | 1815 pref_key, |
| 1816 incognito); | 1816 from_incognito); |
| 1817 } | 1817 } |
| 1818 | 1818 |
| 1819 bool ExtensionPrefs::HasIncognitoPrefValue(const std::string& pref_key) { | 1819 bool ExtensionPrefs::HasIncognitoPrefValue(const std::string& pref_key) { |
| 1820 bool has_incognito_pref_value = false; | 1820 bool has_incognito_pref_value = false; |
| 1821 extension_pref_value_map_->GetEffectivePrefValue(pref_key, | 1821 extension_pref_value_map_->GetEffectivePrefValue(pref_key, |
| 1822 true, | 1822 true, |
| 1823 &has_incognito_pref_value); | 1823 &has_incognito_pref_value); |
| 1824 return has_incognito_pref_value; | 1824 return has_incognito_pref_value; |
| 1825 } | 1825 } |
| 1826 | 1826 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1879 PrefService::UNSYNCABLE_PREF); | 1879 PrefService::UNSYNCABLE_PREF); |
| 1880 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, | 1880 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, |
| 1881 0, // default value | 1881 0, // default value |
| 1882 PrefService::UNSYNCABLE_PREF); | 1882 PrefService::UNSYNCABLE_PREF); |
| 1883 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, | 1883 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, |
| 1884 0, // default value | 1884 0, // default value |
| 1885 PrefService::UNSYNCABLE_PREF); | 1885 PrefService::UNSYNCABLE_PREF); |
| 1886 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, | 1886 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, |
| 1887 PrefService::UNSYNCABLE_PREF); | 1887 PrefService::UNSYNCABLE_PREF); |
| 1888 } | 1888 } |
| OLD | NEW |