| 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 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 << "Extension controlled preference key " << pref_key | 1856 << "Extension controlled preference key " << pref_key |
| 1857 << " not registered."; | 1857 << " not registered."; |
| 1858 | 1858 |
| 1859 return extension_pref_value_map_->CanExtensionControlPref(extension_id, | 1859 return extension_pref_value_map_->CanExtensionControlPref(extension_id, |
| 1860 pref_key, | 1860 pref_key, |
| 1861 incognito); | 1861 incognito); |
| 1862 } | 1862 } |
| 1863 | 1863 |
| 1864 bool ExtensionPrefs::DoesExtensionControlPref(const std::string& extension_id, | 1864 bool ExtensionPrefs::DoesExtensionControlPref(const std::string& extension_id, |
| 1865 const std::string& pref_key, | 1865 const std::string& pref_key, |
| 1866 bool incognito) { | 1866 bool* from_incognito) { |
| 1867 DCHECK(pref_service()->FindPreference(pref_key.c_str())) | 1867 DCHECK(pref_service()->FindPreference(pref_key.c_str())) |
| 1868 << "Extension controlled preference key " << pref_key | 1868 << "Extension controlled preference key " << pref_key |
| 1869 << " not registered."; | 1869 << " not registered."; |
| 1870 | 1870 |
| 1871 return extension_pref_value_map_->DoesExtensionControlPref(extension_id, | 1871 return extension_pref_value_map_->DoesExtensionControlPref(extension_id, |
| 1872 pref_key, | 1872 pref_key, |
| 1873 incognito); | 1873 from_incognito); |
| 1874 } | 1874 } |
| 1875 | 1875 |
| 1876 bool ExtensionPrefs::HasIncognitoPrefValue(const std::string& pref_key) { | 1876 bool ExtensionPrefs::HasIncognitoPrefValue(const std::string& pref_key) { |
| 1877 bool has_incognito_pref_value = false; | 1877 bool has_incognito_pref_value = false; |
| 1878 extension_pref_value_map_->GetEffectivePrefValue(pref_key, | 1878 extension_pref_value_map_->GetEffectivePrefValue(pref_key, |
| 1879 true, | 1879 true, |
| 1880 &has_incognito_pref_value); | 1880 &has_incognito_pref_value); |
| 1881 return has_incognito_pref_value; | 1881 return has_incognito_pref_value; |
| 1882 } | 1882 } |
| 1883 | 1883 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1936 PrefService::UNSYNCABLE_PREF); | 1936 PrefService::UNSYNCABLE_PREF); |
| 1937 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, | 1937 prefs->RegisterInt64Pref(prefs::kLastExtensionsUpdateCheck, |
| 1938 0, // default value | 1938 0, // default value |
| 1939 PrefService::UNSYNCABLE_PREF); | 1939 PrefService::UNSYNCABLE_PREF); |
| 1940 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, | 1940 prefs->RegisterInt64Pref(prefs::kNextExtensionsUpdateCheck, |
| 1941 0, // default value | 1941 0, // default value |
| 1942 PrefService::UNSYNCABLE_PREF); | 1942 PrefService::UNSYNCABLE_PREF); |
| 1943 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, | 1943 prefs->RegisterListPref(prefs::kExtensionAllowedInstallSites, |
| 1944 PrefService::UNSYNCABLE_PREF); | 1944 PrefService::UNSYNCABLE_PREF); |
| 1945 } | 1945 } |
| OLD | NEW |