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/chromeos/settings/cros_settings.h" | 5 #include "chrome/browser/chromeos/settings/cros_settings.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 void CrosSettings::SetDouble(const std::string& path, double in_value) { | 134 void CrosSettings::SetDouble(const std::string& path, double in_value) { |
135 DCHECK(CalledOnValidThread()); | 135 DCHECK(CalledOnValidThread()); |
136 base::Value value(in_value); | 136 base::Value value(in_value); |
137 Set(path, value); | 137 Set(path, value); |
138 } | 138 } |
139 | 139 |
140 void CrosSettings::SetString(const std::string& path, | 140 void CrosSettings::SetString(const std::string& path, |
141 const std::string& in_value) { | 141 const std::string& in_value) { |
142 DCHECK(CalledOnValidThread()); | 142 DCHECK(CalledOnValidThread()); |
143 base::StringValue value(in_value); | 143 base::Value value(in_value); |
144 Set(path, value); | 144 Set(path, value); |
145 } | 145 } |
146 | 146 |
147 void CrosSettings::AppendToList(const std::string& path, | 147 void CrosSettings::AppendToList(const std::string& path, |
148 const base::Value* value) { | 148 const base::Value* value) { |
149 DCHECK(CalledOnValidThread()); | 149 DCHECK(CalledOnValidThread()); |
150 const base::Value* old_value = GetPref(path); | 150 const base::Value* old_value = GetPref(path); |
151 std::unique_ptr<base::Value> new_value(old_value ? old_value->DeepCopy() | 151 std::unique_ptr<base::Value> new_value(old_value ? old_value->DeepCopy() |
152 : new base::ListValue()); | 152 : new base::ListValue()); |
153 static_cast<base::ListValue*>(new_value.get()) | 153 static_cast<base::ListValue*>(new_value.get()) |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 348 |
349 ScopedTestCrosSettings::ScopedTestCrosSettings() { | 349 ScopedTestCrosSettings::ScopedTestCrosSettings() { |
350 CrosSettings::Initialize(); | 350 CrosSettings::Initialize(); |
351 } | 351 } |
352 | 352 |
353 ScopedTestCrosSettings::~ScopedTestCrosSettings() { | 353 ScopedTestCrosSettings::~ScopedTestCrosSettings() { |
354 CrosSettings::Shutdown(); | 354 CrosSettings::Shutdown(); |
355 } | 355 } |
356 | 356 |
357 } // namespace chromeos | 357 } // namespace chromeos |
OLD | NEW |