| OLD | NEW |
| 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 "base/prefs/testing_pref_store.h" | 5 #include "base/prefs/testing_pref_store.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 | 9 |
| 10 TestingPrefStore::TestingPrefStore() | 10 TestingPrefStore::TestingPrefStore() |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 void TestingPrefStore::SetValueSilently(const std::string& key, | 46 void TestingPrefStore::SetValueSilently(const std::string& key, |
| 47 base::Value* value) { | 47 base::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 | |
| 59 bool TestingPrefStore::ReadOnly() const { | 56 bool TestingPrefStore::ReadOnly() const { |
| 60 return read_only_; | 57 return read_only_; |
| 61 } | 58 } |
| 62 | 59 |
| 63 PersistentPrefStore::PrefReadError TestingPrefStore::GetReadError() const { | 60 PersistentPrefStore::PrefReadError TestingPrefStore::GetReadError() const { |
| 64 return PersistentPrefStore::PREF_READ_ERROR_NONE; | 61 return PersistentPrefStore::PREF_READ_ERROR_NONE; |
| 65 } | 62 } |
| 66 | 63 |
| 67 PersistentPrefStore::PrefReadError TestingPrefStore::ReadPrefs() { | 64 PersistentPrefStore::PrefReadError TestingPrefStore::ReadPrefs() { |
| 68 NotifyInitializationCompleted(); | 65 NotifyInitializationCompleted(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return false; | 124 return false; |
| 128 | 125 |
| 129 return stored_value->GetAsBoolean(value); | 126 return stored_value->GetAsBoolean(value); |
| 130 } | 127 } |
| 131 | 128 |
| 132 void TestingPrefStore::set_read_only(bool read_only) { | 129 void TestingPrefStore::set_read_only(bool read_only) { |
| 133 read_only_ = read_only; | 130 read_only_ = read_only; |
| 134 } | 131 } |
| 135 | 132 |
| 136 TestingPrefStore::~TestingPrefStore() {} | 133 TestingPrefStore::~TestingPrefStore() {} |
| OLD | NEW |