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 "components/prefs/testing_pref_store.h" | 5 #include "components/prefs/testing_pref_store.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 117 } |
118 | 118 |
119 void TestingPrefStore::ReportValueChanged(const std::string& key, | 119 void TestingPrefStore::ReportValueChanged(const std::string& key, |
120 uint32_t flags) { | 120 uint32_t flags) { |
121 for (Observer& observer : observers_) | 121 for (Observer& observer : observers_) |
122 observer.OnPrefValueChanged(key); | 122 observer.OnPrefValueChanged(key); |
123 } | 123 } |
124 | 124 |
125 void TestingPrefStore::SetString(const std::string& key, | 125 void TestingPrefStore::SetString(const std::string& key, |
126 const std::string& value) { | 126 const std::string& value) { |
127 SetValue(key, base::MakeUnique<base::StringValue>(value), | 127 SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS); |
128 DEFAULT_PREF_WRITE_FLAGS); | |
129 } | 128 } |
130 | 129 |
131 void TestingPrefStore::SetInteger(const std::string& key, int value) { | 130 void TestingPrefStore::SetInteger(const std::string& key, int value) { |
132 SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS); | 131 SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS); |
133 } | 132 } |
134 | 133 |
135 void TestingPrefStore::SetBoolean(const std::string& key, bool value) { | 134 void TestingPrefStore::SetBoolean(const std::string& key, bool value) { |
136 SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS); | 135 SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS); |
137 } | 136 } |
138 | 137 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 read_success_ = read_success; | 180 read_success_ = read_success; |
182 } | 181 } |
183 | 182 |
184 void TestingPrefStore::set_read_error( | 183 void TestingPrefStore::set_read_error( |
185 PersistentPrefStore::PrefReadError read_error) { | 184 PersistentPrefStore::PrefReadError read_error) { |
186 DCHECK(!init_complete_); | 185 DCHECK(!init_complete_); |
187 read_error_ = read_error; | 186 read_error_ = read_error; |
188 } | 187 } |
189 | 188 |
190 TestingPrefStore::~TestingPrefStore() {} | 189 TestingPrefStore::~TestingPrefStore() {} |
OLD | NEW |