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

Side by Side Diff: chrome/browser/prefs/testing_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/browser/prefs/testing_pref_store.h ('k') | chrome/browser/prefs/value_map_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/browser/prefs/testing_pref_store.h" 5 #include "chrome/browser/prefs/testing_pref_store.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 8
9 TestingPrefStore::TestingPrefStore() 9 TestingPrefStore::TestingPrefStore()
10 : read_only_(true), 10 : read_only_(true),
11 prefs_written_(false), 11 prefs_written_(false),
(...skipping 12 matching lines...) Expand all
24 } 24 }
25 25
26 void TestingPrefStore::AddObserver(PrefStore::Observer* observer) { 26 void TestingPrefStore::AddObserver(PrefStore::Observer* observer) {
27 observers_.AddObserver(observer); 27 observers_.AddObserver(observer);
28 } 28 }
29 29
30 void TestingPrefStore::RemoveObserver(PrefStore::Observer* observer) { 30 void TestingPrefStore::RemoveObserver(PrefStore::Observer* observer) {
31 observers_.RemoveObserver(observer); 31 observers_.RemoveObserver(observer);
32 } 32 }
33 33
34 size_t TestingPrefStore::NumberOfObservers() const {
35 return observers_.size();
36 }
37
34 bool TestingPrefStore::IsInitializationComplete() const { 38 bool TestingPrefStore::IsInitializationComplete() const {
35 return init_complete_; 39 return init_complete_;
36 } 40 }
37 41
38 void TestingPrefStore::SetValue(const std::string& key, Value* value) { 42 void TestingPrefStore::SetValue(const std::string& key, Value* value) {
39 if (prefs_.SetValue(key, value)) 43 if (prefs_.SetValue(key, value))
40 NotifyPrefValueChanged(key); 44 NotifyPrefValueChanged(key);
41 } 45 }
42 46
43 void TestingPrefStore::SetValueSilently(const std::string& key, Value* value) { 47 void TestingPrefStore::SetValueSilently(const std::string& key, Value* value) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 const Value* stored_value; 120 const Value* stored_value;
117 if (!prefs_.GetValue(key, &stored_value) || !stored_value) 121 if (!prefs_.GetValue(key, &stored_value) || !stored_value)
118 return false; 122 return false;
119 123
120 return stored_value->GetAsBoolean(value); 124 return stored_value->GetAsBoolean(value);
121 } 125 }
122 126
123 void TestingPrefStore::set_read_only(bool read_only) { 127 void TestingPrefStore::set_read_only(bool read_only) {
124 read_only_ = read_only; 128 read_only_ = read_only;
125 } 129 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/testing_pref_store.h ('k') | chrome/browser/prefs/value_map_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698