| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cros_settings_provider_user.h" | 5 #include "chrome/browser/chromeos/cros_settings_provider_user.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/chromeos/cros_settings_names.h" | 8 #include "chrome/browser/chromeos/cros_settings_names.h" |
| 9 | 9 |
| 10 namespace chromeos { | 10 namespace chromeos { |
| 11 | 11 |
| 12 UserCrosSettingsProvider::UserCrosSettingsProvider() | 12 UserCrosSettingsProvider::UserCrosSettingsProvider() |
| 13 : dict_(new DictionaryValue) { | 13 : dict_(new DictionaryValue) { |
| 14 Set(kAccountsPrefAllowBWSI, Value::CreateBooleanValue(true)); | 14 Set(kAccountsPrefAllowBWSI, Value::CreateBooleanValue(true)); |
| 15 Set(kAccountsPrefAllowGuest, Value::CreateBooleanValue(true)); | 15 Set(kAccountsPrefAllowGuest, Value::CreateBooleanValue(true)); |
| 16 Set(kAccountsPrefShowUserNamesOnSignIn, Value::CreateBooleanValue(true)); |
| 16 | 17 |
| 17 ListValue* user_list = new ListValue; | 18 ListValue* user_list = new ListValue; |
| 18 | 19 |
| 19 DictionaryValue* mock_user = new DictionaryValue; | 20 DictionaryValue* mock_user = new DictionaryValue; |
| 20 mock_user->SetString(L"email", L"mock_user_1@gmail.com"); | 21 mock_user->SetString(L"email", L"mock_user_1@gmail.com"); |
| 22 mock_user->SetString(L"name", L"Mock User One"); |
| 23 mock_user->SetBoolean(L"owner", true); |
| 21 user_list->Append(mock_user); | 24 user_list->Append(mock_user); |
| 22 | 25 |
| 23 mock_user = new DictionaryValue; | 26 mock_user = new DictionaryValue; |
| 24 mock_user->SetString(L"email", L"mock_user_2@gmail.com"); | 27 mock_user->SetString(L"email", L"mock_user_2@gmail.com"); |
| 28 mock_user->SetString(L"name", L"Mock User Two"); |
| 29 mock_user->SetBoolean(L"owner", false); |
| 25 user_list->Append(mock_user); | 30 user_list->Append(mock_user); |
| 26 | 31 |
| 27 Set(kAccountsPrefUsers, user_list); | 32 Set(kAccountsPrefUsers, user_list); |
| 28 } | 33 } |
| 29 | 34 |
| 30 void UserCrosSettingsProvider::Set(const std::wstring& path, Value* in_value) { | 35 void UserCrosSettingsProvider::Set(const std::wstring& path, Value* in_value) { |
| 31 dict_->Set(path, in_value); | 36 dict_->Set(path, in_value); |
| 32 } | 37 } |
| 33 | 38 |
| 34 bool UserCrosSettingsProvider::Get(const std::wstring& path, | 39 bool UserCrosSettingsProvider::Get(const std::wstring& path, |
| 35 Value** out_value) const { | 40 Value** out_value) const { |
| 36 return dict_->Get(path, out_value); | 41 return dict_->Get(path, out_value); |
| 37 } | 42 } |
| 38 | 43 |
| 39 bool UserCrosSettingsProvider::HandlesSetting(const std::wstring& path) { | 44 bool UserCrosSettingsProvider::HandlesSetting(const std::wstring& path) { |
| 40 return ::StartsWith(path, std::wstring(L"cros.accounts"), true); | 45 return ::StartsWith(path, std::wstring(L"cros.accounts"), true); |
| 41 } | 46 } |
| 42 | 47 |
| 43 } // namespace chromeos | 48 } // namespace chromeos |
| OLD | NEW |