| 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/prefs/pref_service.h" | 5 #include "chrome/browser/prefs/pref_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 base::Bind(&NotifyReadError, message_id)); | 108 base::Bind(&NotifyReadError, message_id)); |
| 109 } | 109 } |
| 110 UMA_HISTOGRAM_ENUMERATION("PrefService.ReadError", error, | 110 UMA_HISTOGRAM_ENUMERATION("PrefService.ReadError", error, |
| 111 PersistentPrefStore::PREF_READ_ERROR_MAX_ENUM); | 111 PersistentPrefStore::PREF_READ_ERROR_MAX_ENUM); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace | 116 } // namespace |
| 117 | 117 |
| 118 PrefServiceBase* PrefServiceBase::ForContext(BrowserContext* context) { | 118 PrefServiceBase* PrefServiceBase::FromBrowserContext(BrowserContext* context) { |
| 119 return static_cast<Profile*>(context)->GetPrefs(); | 119 return static_cast<Profile*>(context)->GetPrefs(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // static | 122 // static |
| 123 PrefService* PrefService::CreatePrefService( | 123 PrefService* PrefService::CreatePrefService( |
| 124 const FilePath& pref_filename, | 124 const FilePath& pref_filename, |
| 125 policy::PolicyService* policy_service, | 125 policy::PolicyService* policy_service, |
| 126 PrefStore* extension_prefs, | 126 PrefStore* extension_prefs, |
| 127 bool async) { | 127 bool async) { |
| 128 using policy::ConfigurationPolicyPrefStore; | 128 using policy::ConfigurationPolicyPrefStore; |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 return pref_value_store()->PrefValueFromDefaultStore(name_.c_str()); | 1047 return pref_value_store()->PrefValueFromDefaultStore(name_.c_str()); |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 bool PrefService::Preference::IsUserModifiable() const { | 1050 bool PrefService::Preference::IsUserModifiable() const { |
| 1051 return pref_value_store()->PrefValueUserModifiable(name_.c_str()); | 1051 return pref_value_store()->PrefValueUserModifiable(name_.c_str()); |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 bool PrefService::Preference::IsExtensionModifiable() const { | 1054 bool PrefService::Preference::IsExtensionModifiable() const { |
| 1055 return pref_value_store()->PrefValueExtensionModifiable(name_.c_str()); | 1055 return pref_value_store()->PrefValueExtensionModifiable(name_.c_str()); |
| 1056 } | 1056 } |
| OLD | NEW |