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

Side by Side Diff: chrome/common/json_pref_store.cc

Issue 9251026: Reinitialize LocalState's CommandLinePrefStore after about_flags updates the command line. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix presubmit checks, no code change Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/json_pref_store.h ('k') | chrome/common/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) 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/common/json_pref_store.h" 5 #include "chrome/common/json_pref_store.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 void JsonPrefStore::AddObserver(PrefStore::Observer* observer) { 164 void JsonPrefStore::AddObserver(PrefStore::Observer* observer) {
165 observers_.AddObserver(observer); 165 observers_.AddObserver(observer);
166 } 166 }
167 167
168 void JsonPrefStore::RemoveObserver(PrefStore::Observer* observer) { 168 void JsonPrefStore::RemoveObserver(PrefStore::Observer* observer) {
169 observers_.RemoveObserver(observer); 169 observers_.RemoveObserver(observer);
170 } 170 }
171 171
172 size_t JsonPrefStore::NumberOfObservers() const {
173 return observers_.size();
174 }
175
172 bool JsonPrefStore::IsInitializationComplete() const { 176 bool JsonPrefStore::IsInitializationComplete() const {
173 return initialized_; 177 return initialized_;
174 } 178 }
175 179
176 PrefStore::ReadResult JsonPrefStore::GetMutableValue(const std::string& key, 180 PrefStore::ReadResult JsonPrefStore::GetMutableValue(const std::string& key,
177 Value** result) { 181 Value** result) {
178 return prefs_->Get(key, result) ? READ_OK : READ_NO_VALUE; 182 return prefs_->Get(key, result) ? READ_OK : READ_NO_VALUE;
179 } 183 }
180 184
181 void JsonPrefStore::SetValue(const std::string& key, Value* value) { 185 void JsonPrefStore::SetValue(const std::string& key, Value* value) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 298 }
295 299
296 bool JsonPrefStore::SerializeData(std::string* output) { 300 bool JsonPrefStore::SerializeData(std::string* output) {
297 // TODO(tc): Do we want to prune webkit preferences that match the default 301 // TODO(tc): Do we want to prune webkit preferences that match the default
298 // value? 302 // value?
299 JSONStringValueSerializer serializer(output); 303 JSONStringValueSerializer serializer(output);
300 serializer.set_pretty_print(true); 304 serializer.set_pretty_print(true);
301 scoped_ptr<DictionaryValue> copy(prefs_->DeepCopyWithoutEmptyChildren()); 305 scoped_ptr<DictionaryValue> copy(prefs_->DeepCopyWithoutEmptyChildren());
302 return serializer.Serialize(*(copy.get())); 306 return serializer.Serialize(*(copy.get()));
303 } 307 }
OLDNEW
« no previous file with comments | « chrome/common/json_pref_store.h ('k') | chrome/common/pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698