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

Side by Side Diff: ash/test/test_session_state_delegate.cc

Issue 14756019: Adding new user menu section to the SystemTrayMenu & refactoring of user access (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ash/test/test_session_state_delegate.h" 5 #include "ash/test/test_session_state_delegate.h"
6 6
7 #include "base/string16.h"
8 #include "base/utf_string_conversions.h"
9
7 namespace ash { 10 namespace ash {
8 namespace test { 11 namespace test {
9 12
10 TestSessionStateDelegate::TestSessionStateDelegate() 13 TestSessionStateDelegate::TestSessionStateDelegate()
11 : has_active_user_(true), 14 : has_active_user_(true),
12 active_user_session_started_(true), 15 active_user_session_started_(true),
13 can_lock_screen_(true), 16 can_lock_screen_(true),
14 screen_locked_(false) { 17 screen_locked_(false) {
15 } 18 }
16 19
17 TestSessionStateDelegate::~TestSessionStateDelegate() { 20 TestSessionStateDelegate::~TestSessionStateDelegate() {
18 } 21 }
19 22
20 bool TestSessionStateDelegate::HasActiveUser() const { 23 int TestSessionStateDelegate::GetMaximumNumberOfLoggedInUsers() const {
21 return has_active_user_; 24 return 3;
25 }
26
27 int TestSessionStateDelegate::NumberOfLoggedInUsers() const {
28 // TODO(skuhne): Add better test framework to test multiple profiles.
29 return has_active_user_ ? 1 : 0;
22 } 30 }
23 31
24 bool TestSessionStateDelegate::IsActiveUserSessionStarted() const { 32 bool TestSessionStateDelegate::IsActiveUserSessionStarted() const {
25 return active_user_session_started_; 33 return active_user_session_started_;
26 } 34 }
27 35
28 bool TestSessionStateDelegate::CanLockScreen() const { 36 bool TestSessionStateDelegate::CanLockScreen() const {
29 return has_active_user_ && can_lock_screen_; 37 return has_active_user_ && can_lock_screen_;
30 } 38 }
31 39
(...skipping 20 matching lines...) Expand all
52 bool active_user_session_started) { 60 bool active_user_session_started) {
53 active_user_session_started_ = active_user_session_started; 61 active_user_session_started_ = active_user_session_started;
54 if (active_user_session_started) 62 if (active_user_session_started)
55 has_active_user_ = true; 63 has_active_user_ = true;
56 } 64 }
57 65
58 void TestSessionStateDelegate::SetCanLockScreen(bool can_lock_screen) { 66 void TestSessionStateDelegate::SetCanLockScreen(bool can_lock_screen) {
59 can_lock_screen_ = can_lock_screen; 67 can_lock_screen_ = can_lock_screen;
60 } 68 }
61 69
70 const base::string16 TestSessionStateDelegate::GetUserDisplayName(
71 ash::MultiProfileIndex index) const {
72 return UTF8ToUTF16("Über tray Über tray Über tray Über tray");
73 }
74
75 const std::string TestSessionStateDelegate::GetUserEmail(
76 ash::MultiProfileIndex index) const {
77 return "über@tray";
78 }
79
80 const gfx::ImageSkia& TestSessionStateDelegate::GetUserImage(
81 ash::MultiProfileIndex index) const {
82 return null_image_;
83 }
84
85 void TestSessionStateDelegate::GetLoggedInUsers(UserEmailList* users) {
86 }
87
88 void TestSessionStateDelegate::SwitchActiveUser(const std::string& email) {
89 }
90
91
62 } // namespace test 92 } // namespace test
63 } // namespace ash 93 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698