| 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 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1809 bool incognito) { | 1809 bool 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 incognito); |
| 1817 } | 1817 } |
| 1818 | 1818 |
| 1819 bool ExtensionPrefs::DoesExtensionControlIncognitoPref( |
| 1820 const std::string& extension_id, |
| 1821 const std::string& pref_key) { |
| 1822 DCHECK(pref_service()->FindPreference(pref_key.c_str())) |
| 1823 << "Extension controlled preference key " << pref_key |
| 1824 << " not registered."; |
| 1825 |
| 1826 return extension_pref_value_map_->DoesExtensionControlIncognitoPref( |
| 1827 extension_id, |
| 1828 pref_key); |
| 1829 } |
| 1830 |
| 1819 bool ExtensionPrefs::HasIncognitoPrefValue(const std::string& pref_key) { | 1831 bool ExtensionPrefs::HasIncognitoPrefValue(const std::string& pref_key) { |
| 1820 bool has_incognito_pref_value = false; | 1832 bool has_incognito_pref_value = false; |
| 1821 extension_pref_value_map_->GetEffectivePrefValue(pref_key, | 1833 extension_pref_value_map_->GetEffectivePrefValue(pref_key, |
| 1822 true, | 1834 true, |
| 1823 &has_incognito_pref_value); | 1835 &has_incognito_pref_value); |
| 1824 return has_incognito_pref_value; | 1836 return has_incognito_pref_value; |
| 1825 } | 1837 } |
| 1826 | 1838 |
| 1827 void ExtensionPrefs::ClearIncognitoSessionOnlyContentSettings() { | 1839 void ExtensionPrefs::ClearIncognitoSessionOnlyContentSettings() { |
| 1828 ExtensionIdSet extension_ids; | 1840 ExtensionIdSet extension_ids; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1879 PrefService::UNSYNCABLE_PREF); | 1891 PrefService::UNSYNCABLE_PREF); |
| 1880 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, | 1892 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, |
| 1881 0, // default value | 1893 0, // default value |
| 1882 PrefService::UNSYNCABLE_PREF); | 1894 PrefService::UNSYNCABLE_PREF); |
| 1883 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, | 1895 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, |
| 1884 0, // default value | 1896 0, // default value |
| 1885 PrefService::UNSYNCABLE_PREF); | 1897 PrefService::UNSYNCABLE_PREF); |
| 1886 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, | 1898 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, |
| 1887 PrefService::UNSYNCABLE_PREF); | 1899 PrefService::UNSYNCABLE_PREF); |
| 1888 } | 1900 } |
| OLD | NEW |