Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: chrome/browser/pref_service.cc

Issue 1692011: Implementation of managed policy: Policy Abstraction (Closed)
Patch Set: check no changes Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/json_pref_store_unittest.cc ('k') | chrome/browser/pref_store.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/json_pref_store_unittest.cc ('k') | chrome/browser/pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698