| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 can_lock_screen_(true), | 33 can_lock_screen_(true), |
| 34 should_lock_screen_before_suspending_(false), | 34 should_lock_screen_before_suspending_(false), |
| 35 screen_locked_(false), | 35 screen_locked_(false), |
| 36 user_adding_screen_running_(false), | 36 user_adding_screen_running_(false), |
| 37 logged_in_users_(1) { | 37 logged_in_users_(1) { |
| 38 } | 38 } |
| 39 | 39 |
| 40 TestSessionStateDelegate::~TestSessionStateDelegate() { | 40 TestSessionStateDelegate::~TestSessionStateDelegate() { |
| 41 } | 41 } |
| 42 | 42 |
| 43 content::BrowserContext* |
| 44 TestSessionStateDelegate::GetBrowserContextByIndex( |
| 45 MultiProfileIndex index) { |
| 46 return NULL; |
| 47 } |
| 48 |
| 43 int TestSessionStateDelegate::GetMaximumNumberOfLoggedInUsers() const { | 49 int TestSessionStateDelegate::GetMaximumNumberOfLoggedInUsers() const { |
| 44 return 3; | 50 return 3; |
| 45 } | 51 } |
| 46 | 52 |
| 47 int TestSessionStateDelegate::NumberOfLoggedInUsers() const { | 53 int TestSessionStateDelegate::NumberOfLoggedInUsers() const { |
| 48 // TODO(skuhne): Add better test framework to test multiple profiles. | 54 // TODO(skuhne): Add better test framework to test multiple profiles. |
| 49 return has_active_user_ ? logged_in_users_ : 0; | 55 return has_active_user_ ? logged_in_users_ : 0; |
| 50 } | 56 } |
| 51 | 57 |
| 52 bool TestSessionStateDelegate::IsActiveUserSessionStarted() const { | 58 bool TestSessionStateDelegate::IsActiveUserSessionStarted() const { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 default: return "someone@tray"; | 132 default: return "someone@tray"; |
| 127 } | 133 } |
| 128 } | 134 } |
| 129 | 135 |
| 130 const std::string TestSessionStateDelegate::GetUserID( | 136 const std::string TestSessionStateDelegate::GetUserID( |
| 131 MultiProfileIndex index) const { | 137 MultiProfileIndex index) const { |
| 132 return GetUserIDFromEmail(GetUserEmail(index)); | 138 return GetUserIDFromEmail(GetUserEmail(index)); |
| 133 } | 139 } |
| 134 | 140 |
| 135 const gfx::ImageSkia& TestSessionStateDelegate::GetUserImage( | 141 const gfx::ImageSkia& TestSessionStateDelegate::GetUserImage( |
| 136 MultiProfileIndex index) const { | 142 content::BrowserContext* context) const { |
| 137 return null_image_; | 143 return null_image_; |
| 138 } | 144 } |
| 139 | 145 |
| 140 void TestSessionStateDelegate::GetLoggedInUsers(UserIdList* users) { | 146 bool TestSessionStateDelegate::ShouldShowAvatar(aura::Window* window) { |
| 147 return false; |
| 141 } | 148 } |
| 142 | 149 |
| 143 void TestSessionStateDelegate::SwitchActiveUser(const std::string& user_id) { | 150 void TestSessionStateDelegate::SwitchActiveUser(const std::string& user_id) { |
| 144 // Make sure this is a user id and not an email address. | 151 // Make sure this is a user id and not an email address. |
| 145 EXPECT_EQ(user_id, GetUserIDFromEmail(user_id)); | 152 EXPECT_EQ(user_id, GetUserIDFromEmail(user_id)); |
| 146 activated_user_ = user_id; | 153 activated_user_ = user_id; |
| 147 } | 154 } |
| 148 | 155 |
| 149 void TestSessionStateDelegate::CycleActiveUser(CycleUser cycle_user) { | 156 void TestSessionStateDelegate::CycleActiveUser(CycleUser cycle_user) { |
| 150 activated_user_ = "someone@tray"; | 157 activated_user_ = "someone@tray"; |
| 151 } | 158 } |
| 152 | 159 |
| 153 void TestSessionStateDelegate::AddSessionStateObserver( | 160 void TestSessionStateDelegate::AddSessionStateObserver( |
| 154 SessionStateObserver* observer) { | 161 SessionStateObserver* observer) { |
| 155 } | 162 } |
| 156 | 163 |
| 157 void TestSessionStateDelegate::RemoveSessionStateObserver( | 164 void TestSessionStateDelegate::RemoveSessionStateObserver( |
| 158 SessionStateObserver* observer) { | 165 SessionStateObserver* observer) { |
| 159 } | 166 } |
| 160 | 167 |
| 161 } // namespace test | 168 } // namespace test |
| 162 } // namespace ash | 169 } // namespace ash |
| OLD | NEW |