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

Side by Side Diff: chrome/browser/prefs/testing_pref_store.cc

Issue 10055003: Keep emtpy List/Dictionary pref value with non-empty default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for comments in #1 Created 8 years, 8 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
OLDNEW
1 // Copyright (c) 2012 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),
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 void TestingPrefStore::SetValueSilently(const std::string& key, Value* value) { 47 void TestingPrefStore::SetValueSilently(const std::string& key, Value* value) {
48 prefs_.SetValue(key, value); 48 prefs_.SetValue(key, value);
49 } 49 }
50 50
51 void TestingPrefStore::RemoveValue(const std::string& key) { 51 void TestingPrefStore::RemoveValue(const std::string& key) {
52 if (prefs_.RemoveValue(key)) 52 if (prefs_.RemoveValue(key))
53 NotifyPrefValueChanged(key); 53 NotifyPrefValueChanged(key);
54 } 54 }
55 55
56 void TestingPrefStore::MarkNeedsEmptyValue(const std::string& key) {
57 }
58
56 bool TestingPrefStore::ReadOnly() const { 59 bool TestingPrefStore::ReadOnly() const {
57 return read_only_; 60 return read_only_;
58 } 61 }
59 62
60 PersistentPrefStore::PrefReadError TestingPrefStore::GetReadError() const { 63 PersistentPrefStore::PrefReadError TestingPrefStore::GetReadError() const {
61 return PersistentPrefStore::PREF_READ_ERROR_NONE; 64 return PersistentPrefStore::PREF_READ_ERROR_NONE;
62 } 65 }
63 66
64 PersistentPrefStore::PrefReadError TestingPrefStore::ReadPrefs() { 67 PersistentPrefStore::PrefReadError TestingPrefStore::ReadPrefs() {
65 prefs_.Clear(); 68 prefs_.Clear();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 const Value* stored_value; 127 const Value* stored_value;
125 if (!prefs_.GetValue(key, &stored_value) || !stored_value) 128 if (!prefs_.GetValue(key, &stored_value) || !stored_value)
126 return false; 129 return false;
127 130
128 return stored_value->GetAsBoolean(value); 131 return stored_value->GetAsBoolean(value);
129 } 132 }
130 133
131 void TestingPrefStore::set_read_only(bool read_only) { 134 void TestingPrefStore::set_read_only(bool read_only) {
132 read_only_ = read_only; 135 read_only_ = read_only;
133 } 136 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/testing_pref_store.h ('k') | chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698