Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: chrome/browser/chromeos/mock_cros_settings.cc

Issue 3071013: Revert "Revert 53989 - Implement new mock for user options page per chromium-os:5028" (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/mock_cros_settings.h" 5 #include "chrome/browser/chromeos/mock_cros_settings.h"
6 6
7 namespace chromeos { 7 namespace chromeos {
8 8
9 MockCrosSettings::MockCrosSettings() 9 MockCrosSettings::MockCrosSettings()
10 : dict_(new DictionaryValue) { 10 : dict_(new DictionaryValue) {
11 // Some mock settings 11 // Some mock settings
12 SetBoolean(kAccountsPrefAllowBWSI, true); 12 SetBoolean(kAccountsPrefAllowBWSI, true);
13 SetBoolean(kAccountsPrefAllowGuest, true); 13 SetBoolean(kAccountsPrefAllowGuest, true);
14 SetBoolean(kAccountsPrefShowUserNamesOnSignIn, true);
14 15
15 ListValue* user_list = new ListValue; 16 ListValue* user_list = new ListValue;
16 17
17 DictionaryValue* mock_user = new DictionaryValue; 18 DictionaryValue* mock_user = new DictionaryValue;
18 mock_user->SetString(L"email", L"mock_user_1@gmail.com"); 19 mock_user->SetString(L"email", L"mock_user_1@gmail.com");
20 mock_user->SetString(L"name", L"Mock User One");
21 mock_user->SetBoolean(L"owner", true);
19 user_list->Append(mock_user); 22 user_list->Append(mock_user);
20 23
21 mock_user = new DictionaryValue; 24 mock_user = new DictionaryValue;
22 mock_user->SetString(L"email", L"mock_user_2@gmail.com"); 25 mock_user->SetString(L"email", L"mock_user_2@gmail.com");
26 mock_user->SetString(L"name", L"Mock User Two");
27 mock_user->SetBoolean(L"owner", false);
23 user_list->Append(mock_user); 28 user_list->Append(mock_user);
24 29
25 Set(kAccountsPrefUsers, user_list); 30 Set(kAccountsPrefUsers, user_list);
26 } 31 }
27 32
28 void MockCrosSettings::Set(const std::wstring& path, Value* in_value) { 33 void MockCrosSettings::Set(const std::wstring& path, Value* in_value) {
29 dict_->Set(path, in_value); 34 dict_->Set(path, in_value);
30 } 35 }
31 36
32 bool MockCrosSettings::Get(const std::wstring& path, Value** out_value) const { 37 bool MockCrosSettings::Get(const std::wstring& path, Value** out_value) const {
33 return dict_->Get(path, out_value); 38 return dict_->Get(path, out_value);
34 } 39 }
35 40
36 } // namespace chromeos 41 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/dom_ui/accounts_options_handler.cc ('k') | chrome/browser/dom_ui/options_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698