| OLD | NEW |
| 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::NumberOfLoggedInUsers() const { |
| 21 return has_active_user_; | 24 // TODO(skuhne): Add better test framework to test multiple profiles. |
| 25 return has_active_user_ ? 1 : 0; |
| 22 } | 26 } |
| 23 | 27 |
| 24 bool TestSessionStateDelegate::IsActiveUserSessionStarted() const { | 28 bool TestSessionStateDelegate::IsActiveUserSessionStarted() const { |
| 25 return active_user_session_started_; | 29 return active_user_session_started_; |
| 26 } | 30 } |
| 27 | 31 |
| 28 bool TestSessionStateDelegate::CanLockScreen() const { | 32 bool TestSessionStateDelegate::CanLockScreen() const { |
| 29 return has_active_user_ && can_lock_screen_; | 33 return has_active_user_ && can_lock_screen_; |
| 30 } | 34 } |
| 31 | 35 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 52 bool active_user_session_started) { | 56 bool active_user_session_started) { |
| 53 active_user_session_started_ = active_user_session_started; | 57 active_user_session_started_ = active_user_session_started; |
| 54 if (active_user_session_started) | 58 if (active_user_session_started) |
| 55 has_active_user_ = true; | 59 has_active_user_ = true; |
| 56 } | 60 } |
| 57 | 61 |
| 58 void TestSessionStateDelegate::SetCanLockScreen(bool can_lock_screen) { | 62 void TestSessionStateDelegate::SetCanLockScreen(bool can_lock_screen) { |
| 59 can_lock_screen_ = can_lock_screen; | 63 can_lock_screen_ = can_lock_screen; |
| 60 } | 64 } |
| 61 | 65 |
| 66 const base::string16 TestSessionStateDelegate::GetUserDisplayName( |
| 67 ash::MultiProfileIndex index) const { |
| 68 return UTF8ToUTF16("Über tray Über tray Über tray Über tray"); |
| 69 } |
| 70 |
| 71 const std::string TestSessionStateDelegate::GetUserEmail( |
| 72 ash::MultiProfileIndex index) const { |
| 73 return "über@tray"; |
| 74 } |
| 75 |
| 76 const gfx::ImageSkia& TestSessionStateDelegate::GetUserImage( |
| 77 ash::MultiProfileIndex index) const { |
| 78 return null_image_; |
| 79 } |
| 80 |
| 81 void TestSessionStateDelegate::GetLoggedInUsers(UserEmailList* users) { |
| 82 } |
| 83 |
| 84 void TestSessionStateDelegate::SwitchActiveUser(const std::string& email) { |
| 85 } |
| 86 |
| 87 |
| 62 } // namespace test | 88 } // namespace test |
| 63 } // namespace ash | 89 } // namespace ash |
| OLD | NEW |