| 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 "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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |