Chromium Code Reviews| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 const base::Value* value) { | 160 const base::Value* value) { |
| 161 DCHECK(CalledOnValidThread()); | 161 DCHECK(CalledOnValidThread()); |
| 162 const base::Value* old_value = GetPref(path); | 162 const base::Value* old_value = GetPref(path); |
| 163 std::unique_ptr<base::Value> new_value(old_value ? old_value->DeepCopy() | 163 std::unique_ptr<base::Value> new_value(old_value ? old_value->DeepCopy() |
| 164 : new base::ListValue()); | 164 : new base::ListValue()); |
| 165 static_cast<base::ListValue*>(new_value.get())->Remove(*value, NULL); | 165 static_cast<base::ListValue*>(new_value.get())->Remove(*value, NULL); |
| 166 Set(path, *new_value); | 166 Set(path, *new_value); |
| 167 } | 167 } |
| 168 | 168 |
| 169 bool CrosSettings::GetBoolean(const std::string& path, | 169 bool CrosSettings::GetBoolean(const std::string& path, |
| 170 bool* bool_value) const { | 170 bool* bool_value) const { |
|
Greg Levin
2016/08/31 16:52:06
*** Ignore this, it's only here for debugging purp
| |
| 171 if (path == kAccountsPrefShowUserNamesOnSignIn) { | |
| 172 *bool_value = true; // Set to show or hide user pods on signin | |
| 173 return true; | |
| 174 } | |
| 175 | |
| 171 DCHECK(CalledOnValidThread()); | 176 DCHECK(CalledOnValidThread()); |
| 172 const base::Value* value = GetPref(path); | 177 const base::Value* value = GetPref(path); |
| 173 if (value) | 178 if (value) |
| 174 return value->GetAsBoolean(bool_value); | 179 return value->GetAsBoolean(bool_value); |
| 175 return false; | 180 return false; |
| 176 } | 181 } |
| 177 | 182 |
| 178 bool CrosSettings::GetInteger(const std::string& path, | 183 bool CrosSettings::GetInteger(const std::string& path, |
| 179 int* out_value) const { | 184 int* out_value) const { |
| 180 DCHECK(CalledOnValidThread()); | 185 DCHECK(CalledOnValidThread()); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 | 348 |
| 344 ScopedTestCrosSettings::ScopedTestCrosSettings() { | 349 ScopedTestCrosSettings::ScopedTestCrosSettings() { |
| 345 CrosSettings::Initialize(); | 350 CrosSettings::Initialize(); |
| 346 } | 351 } |
| 347 | 352 |
| 348 ScopedTestCrosSettings::~ScopedTestCrosSettings() { | 353 ScopedTestCrosSettings::~ScopedTestCrosSettings() { |
| 349 CrosSettings::Shutdown(); | 354 CrosSettings::Shutdown(); |
| 350 } | 355 } |
| 351 | 356 |
| 352 } // namespace chromeos | 357 } // namespace chromeos |
| OLD | NEW |