| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/pref_service.h" | 5 #include "chrome/browser/pref_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 11 #include "base/histogram.h" | 11 #include "base/histogram.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 bool PrefService::ReloadPersistentPrefs() { | 122 bool PrefService::ReloadPersistentPrefs() { |
| 123 return (LoadPersistentPrefs() == PrefStore::PREF_READ_ERROR_NONE); | 123 return (LoadPersistentPrefs() == PrefStore::PREF_READ_ERROR_NONE); |
| 124 } | 124 } |
| 125 | 125 |
| 126 PrefStore::PrefReadError PrefService::LoadPersistentPrefs() { | 126 PrefStore::PrefReadError PrefService::LoadPersistentPrefs() { |
| 127 DCHECK(CalledOnValidThread()); | 127 DCHECK(CalledOnValidThread()); |
| 128 | 128 |
| 129 PrefStore::PrefReadError pref_error = store_->ReadPrefs(); | 129 PrefStore::PrefReadError pref_error = store_->ReadPrefs(); |
| 130 | 130 |
| 131 persistent_ = store_->Prefs(); | 131 persistent_ = store_->prefs(); |
| 132 | 132 |
| 133 for (PreferenceSet::iterator it = prefs_.begin(); | 133 for (PreferenceSet::iterator it = prefs_.begin(); |
| 134 it != prefs_.end(); ++it) { | 134 it != prefs_.end(); ++it) { |
| 135 (*it)->root_pref_ = persistent_; | 135 (*it)->root_pref_ = persistent_; |
| 136 } | 136 } |
| 137 | 137 |
| 138 return pref_error; | 138 return pref_error; |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool PrefService::SavePersistentPrefs() { | 141 bool PrefService::SavePersistentPrefs() { |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 } | 727 } |
| 728 | 728 |
| 729 // Pref not found, just return the app default. | 729 // Pref not found, just return the app default. |
| 730 return default_value_.get(); | 730 return default_value_.get(); |
| 731 } | 731 } |
| 732 | 732 |
| 733 bool PrefService::Preference::IsDefaultValue() const { | 733 bool PrefService::Preference::IsDefaultValue() const { |
| 734 DCHECK(default_value_.get()); | 734 DCHECK(default_value_.get()); |
| 735 return default_value_->Equals(GetValue()); | 735 return default_value_->Equals(GetValue()); |
| 736 } | 736 } |
| OLD | NEW |