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