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/stub_cros_settings_provider.h" | 5 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/chromeos/settings/cros_settings.h" | 9 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 10 #include "chrome/browser/chromeos/settings/device_settings_provider.h" | 10 #include "chrome/browser/chromeos/settings/device_settings_provider.h" |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 CrosSettingsProvider::TrustedStatus | 38 CrosSettingsProvider::TrustedStatus |
| 39 StubCrosSettingsProvider::PrepareTrustedValues(const base::Closure& cb) { | 39 StubCrosSettingsProvider::PrepareTrustedValues(const base::Closure& cb) { |
| 40 // We don't have a trusted store so all values are available immediately. | 40 // We don't have a trusted store so all values are available immediately. |
| 41 return TRUSTED; | 41 return TRUSTED; |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool StubCrosSettingsProvider::HandlesSetting(const std::string& path) const { | 44 bool StubCrosSettingsProvider::HandlesSetting(const std::string& path) const { |
| 45 return DeviceSettingsProvider::IsDeviceSetting(path); | 45 return DeviceSettingsProvider::IsDeviceSetting(path); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void StubCrosSettingsProvider::SetBoolean(const std::string& path, | |
| 49 bool in_value) { | |
| 50 base::FundamentalValue value(in_value); | |
|
bartfab (slow)
2015/03/31 14:12:41
Nit: const.
| |
| 51 Set(path, value); | |
| 52 } | |
| 53 | |
| 54 void StubCrosSettingsProvider::SetInteger(const std::string& path, | |
| 55 int in_value) { | |
| 56 base::FundamentalValue value(in_value); | |
|
bartfab (slow)
2015/03/31 14:12:41
Nit: const.
| |
| 57 Set(path, value); | |
| 58 } | |
| 59 | |
| 60 void StubCrosSettingsProvider::SetDouble(const std::string& path, | |
| 61 double in_value) { | |
| 62 base::FundamentalValue value(in_value); | |
|
bartfab (slow)
2015/03/31 14:12:41
Nit: const.
| |
| 63 Set(path, value); | |
| 64 } | |
| 65 | |
| 66 void StubCrosSettingsProvider::SetString(const std::string& path, | |
| 67 const std::string& in_value) { | |
| 68 base::StringValue value(in_value); | |
|
bartfab (slow)
2015/03/31 14:12:41
Nit: const.
| |
| 69 Set(path, value); | |
| 70 } | |
| 71 | |
| 48 void StubCrosSettingsProvider::DoSet(const std::string& path, | 72 void StubCrosSettingsProvider::DoSet(const std::string& path, |
| 49 const base::Value& value) { | 73 const base::Value& value) { |
| 50 values_.SetValue(path, value.DeepCopy()); | 74 values_.SetValue(path, value.DeepCopy()); |
| 51 NotifyObservers(path); | 75 NotifyObservers(path); |
| 52 } | 76 } |
| 53 | 77 |
| 54 void StubCrosSettingsProvider::SetDefaults() { | 78 void StubCrosSettingsProvider::SetDefaults() { |
| 55 values_.SetBoolean(kAccountsPrefAllowGuest, true); | 79 values_.SetBoolean(kAccountsPrefAllowGuest, true); |
| 56 values_.SetBoolean(kAccountsPrefAllowNewUser, true); | 80 values_.SetBoolean(kAccountsPrefAllowNewUser, true); |
| 57 values_.SetBoolean(kAccountsPrefSupervisedUsersEnabled, true); | 81 values_.SetBoolean(kAccountsPrefSupervisedUsersEnabled, true); |
| 58 values_.SetBoolean(kAccountsPrefShowUserNamesOnSignIn, true); | 82 values_.SetBoolean(kAccountsPrefShowUserNamesOnSignIn, true); |
| 59 values_.SetValue(kAccountsPrefDeviceLocalAccounts, new base::ListValue); | 83 values_.SetValue(kAccountsPrefDeviceLocalAccounts, new base::ListValue); |
| 60 // |kDeviceOwner| will be set to the logged-in user by |UserManager|. | 84 // |kDeviceOwner| will be set to the logged-in user by |UserManager|. |
| 61 } | 85 } |
| 62 | 86 |
| 63 } // namespace chromeos | 87 } // namespace chromeos |
| OLD | NEW |