OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_value_store.h" | 5 #include "chrome/browser/prefs/pref_value_store.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/prefs/pref_model_associator.h" | 8 #include "chrome/browser/prefs/pref_model_associator.h" |
9 #include "chrome/browser/prefs/pref_notifier.h" | 9 #include "chrome/browser/prefs/pref_notifier.h" |
10 | 10 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 | 158 |
159 bool PrefValueStore::PrefValueFromExtensionStore(const char* name) const { | 159 bool PrefValueStore::PrefValueFromExtensionStore(const char* name) const { |
160 return ControllingPrefStoreForPref(name) == EXTENSION_STORE; | 160 return ControllingPrefStoreForPref(name) == EXTENSION_STORE; |
161 } | 161 } |
162 | 162 |
163 bool PrefValueStore::PrefValueFromUserStore(const char* name) const { | 163 bool PrefValueStore::PrefValueFromUserStore(const char* name) const { |
164 return ControllingPrefStoreForPref(name) == USER_STORE; | 164 return ControllingPrefStoreForPref(name) == USER_STORE; |
165 } | 165 } |
166 | 166 |
| 167 bool PrefValueStore::PrefValueFromRecommendedStore(const char* name) const { |
| 168 return ControllingPrefStoreForPref(name) == RECOMMENDED_PLATFORM_STORE || |
| 169 ControllingPrefStoreForPref(name) == RECOMMENDED_CLOUD_STORE; |
| 170 } |
| 171 |
167 bool PrefValueStore::PrefValueFromDefaultStore(const char* name) const { | 172 bool PrefValueStore::PrefValueFromDefaultStore(const char* name) const { |
168 return ControllingPrefStoreForPref(name) == DEFAULT_STORE; | 173 return ControllingPrefStoreForPref(name) == DEFAULT_STORE; |
169 } | 174 } |
170 | 175 |
171 bool PrefValueStore::PrefValueUserModifiable(const char* name) const { | 176 bool PrefValueStore::PrefValueUserModifiable(const char* name) const { |
172 PrefStoreType effective_store = ControllingPrefStoreForPref(name); | 177 PrefStoreType effective_store = ControllingPrefStoreForPref(name); |
173 return effective_store >= USER_STORE || | 178 return effective_store >= USER_STORE || |
174 effective_store == INVALID_STORE; | 179 effective_store == INVALID_STORE; |
175 } | 180 } |
176 | 181 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 if (initialization_failed_) | 273 if (initialization_failed_) |
269 return; | 274 return; |
270 for (size_t i = 0; i <= PREF_STORE_TYPE_MAX; ++i) { | 275 for (size_t i = 0; i <= PREF_STORE_TYPE_MAX; ++i) { |
271 scoped_refptr<PrefStore> store = | 276 scoped_refptr<PrefStore> store = |
272 GetPrefStore(static_cast<PrefStoreType>(i)); | 277 GetPrefStore(static_cast<PrefStoreType>(i)); |
273 if (store && !store->IsInitializationComplete()) | 278 if (store && !store->IsInitializationComplete()) |
274 return; | 279 return; |
275 } | 280 } |
276 pref_notifier_->OnInitializationCompleted(true); | 281 pref_notifier_->OnInitializationCompleted(true); |
277 } | 282 } |
OLD | NEW |