| 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/login/user_manager.h" | 9 #include "chrome/browser/chromeos/login/user_manager.h" |
| 10 #include "chrome/browser/chromeos/settings/cros_settings.h" | 10 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 StubCrosSettingsProvider::PrepareTrustedValues(const base::Closure& cb) { | 66 StubCrosSettingsProvider::PrepareTrustedValues(const base::Closure& cb) { |
| 67 // We don't have a trusted store so all values are available immediately. | 67 // We don't have a trusted store so all values are available immediately. |
| 68 return TRUSTED; | 68 return TRUSTED; |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool StubCrosSettingsProvider::HandlesSetting(const std::string& path) const { | 71 bool StubCrosSettingsProvider::HandlesSetting(const std::string& path) const { |
| 72 const char** end = kHandledSettings + arraysize(kHandledSettings); | 72 const char** end = kHandledSettings + arraysize(kHandledSettings); |
| 73 return std::find(kHandledSettings, end, path) != end; | 73 return std::find(kHandledSettings, end, path) != end; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void StubCrosSettingsProvider::Reload() { | |
| 77 } | |
| 78 | |
| 79 void StubCrosSettingsProvider::DoSet(const std::string& path, | 76 void StubCrosSettingsProvider::DoSet(const std::string& path, |
| 80 const base::Value& value) { | 77 const base::Value& value) { |
| 81 values_.SetValue(path, value.DeepCopy()); | 78 values_.SetValue(path, value.DeepCopy()); |
| 82 NotifyObservers(path); | 79 NotifyObservers(path); |
| 83 } | 80 } |
| 84 | 81 |
| 85 void StubCrosSettingsProvider::SetDefaults() { | 82 void StubCrosSettingsProvider::SetDefaults() { |
| 86 values_.SetBoolean(kAccountsPrefAllowGuest, true); | 83 values_.SetBoolean(kAccountsPrefAllowGuest, true); |
| 87 values_.SetBoolean(kAccountsPrefAllowNewUser, true); | 84 values_.SetBoolean(kAccountsPrefAllowNewUser, true); |
| 88 values_.SetBoolean(kAccountsPrefShowUserNamesOnSignIn, true); | 85 values_.SetBoolean(kAccountsPrefShowUserNamesOnSignIn, true); |
| 89 // |kDeviceOwner| will be set to the logged-in user by |UserManager|. | 86 // |kDeviceOwner| will be set to the logged-in user by |UserManager|. |
| 90 } | 87 } |
| 91 | 88 |
| 92 } // namespace chromeos | 89 } // namespace chromeos |
| OLD | NEW |