| OLD | NEW |
| 1 // Copyright (c) 2011 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_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 |
| 11 PrefValueStore::PrefStoreKeeper::PrefStoreKeeper() | 11 PrefValueStore::PrefStoreKeeper::PrefStoreKeeper() |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return effective_store >= USER_STORE || | 178 return effective_store >= USER_STORE || |
| 179 effective_store == INVALID_STORE; | 179 effective_store == INVALID_STORE; |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool PrefValueStore::PrefValueExtensionModifiable(const char* name) const { | 182 bool PrefValueStore::PrefValueExtensionModifiable(const char* name) const { |
| 183 PrefStoreType effective_store = ControllingPrefStoreForPref(name); | 183 PrefStoreType effective_store = ControllingPrefStoreForPref(name); |
| 184 return effective_store >= EXTENSION_STORE || | 184 return effective_store >= EXTENSION_STORE || |
| 185 effective_store == INVALID_STORE; | 185 effective_store == INVALID_STORE; |
| 186 } | 186 } |
| 187 | 187 |
| 188 void PrefValueStore::UpdateCommandLinePrefStore(PrefStore* command_line_prefs) { |
| 189 InitPrefStore(COMMAND_LINE_STORE, command_line_prefs); |
| 190 } |
| 191 |
| 188 bool PrefValueStore::PrefValueInStore( | 192 bool PrefValueStore::PrefValueInStore( |
| 189 const char* name, | 193 const char* name, |
| 190 PrefValueStore::PrefStoreType store) const { | 194 PrefValueStore::PrefStoreType store) const { |
| 191 // Declare a temp Value* and call GetValueFromStore, | 195 // Declare a temp Value* and call GetValueFromStore, |
| 192 // ignoring the output value. | 196 // ignoring the output value. |
| 193 const Value* tmp_value = NULL; | 197 const Value* tmp_value = NULL; |
| 194 return GetValueFromStore(name, store, &tmp_value); | 198 return GetValueFromStore(name, store, &tmp_value); |
| 195 } | 199 } |
| 196 | 200 |
| 197 bool PrefValueStore::PrefValueInStoreRange( | 201 bool PrefValueStore::PrefValueInStoreRange( |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 if (initialization_failed_) | 277 if (initialization_failed_) |
| 274 return; | 278 return; |
| 275 for (size_t i = 0; i <= PREF_STORE_TYPE_MAX; ++i) { | 279 for (size_t i = 0; i <= PREF_STORE_TYPE_MAX; ++i) { |
| 276 scoped_refptr<PrefStore> store = | 280 scoped_refptr<PrefStore> store = |
| 277 GetPrefStore(static_cast<PrefStoreType>(i)); | 281 GetPrefStore(static_cast<PrefStoreType>(i)); |
| 278 if (store && !store->IsInitializationComplete()) | 282 if (store && !store->IsInitializationComplete()) |
| 279 return; | 283 return; |
| 280 } | 284 } |
| 281 pref_notifier_->OnInitializationCompleted(true); | 285 pref_notifier_->OnInitializationCompleted(true); |
| 282 } | 286 } |
| OLD | NEW |