| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 const gfx::ImageSkia& user_image) { | 205 const gfx::ImageSkia& user_image) { |
| 206 user_list_[active_user_index_]->SetUserImage(user_image); | 206 user_list_[active_user_index_]->SetUserImage(user_image); |
| 207 } | 207 } |
| 208 | 208 |
| 209 const user_manager::UserInfo* TestSessionStateDelegate::GetUserInfo( | 209 const user_manager::UserInfo* TestSessionStateDelegate::GetUserInfo( |
| 210 UserIndex index) const { | 210 UserIndex index) const { |
| 211 int max = static_cast<int>(user_list_.size()); | 211 int max = static_cast<int>(user_list_.size()); |
| 212 return user_list_[index < max ? index : max - 1]; | 212 return user_list_[index < max ? index : max - 1]; |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool TestSessionStateDelegate::ShouldShowAvatar(aura::Window* window) const { | 215 bool TestSessionStateDelegate::ShouldShowAvatar(WmWindow* window) const { |
| 216 return !GetActiveUserInfo()->GetImage().isNull(); | 216 return !GetActiveUserInfo()->GetImage().isNull(); |
| 217 } | 217 } |
| 218 | 218 |
| 219 gfx::ImageSkia TestSessionStateDelegate::GetAvatarImageForWindow( | 219 gfx::ImageSkia TestSessionStateDelegate::GetAvatarImageForWindow( |
| 220 aura::Window* window) const { | 220 WmWindow* window) const { |
| 221 return gfx::ImageSkia(); | 221 return gfx::ImageSkia(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void TestSessionStateDelegate::SwitchActiveUser(const AccountId& account_id) { | 224 void TestSessionStateDelegate::SwitchActiveUser(const AccountId& account_id) { |
| 225 // Make sure this is a user id and not an email address. | 225 // Make sure this is a user id and not an email address. |
| 226 EXPECT_EQ(account_id.GetUserEmail(), | 226 EXPECT_EQ(account_id.GetUserEmail(), |
| 227 GetUserIdFromEmail(account_id.GetUserEmail())); | 227 GetUserIdFromEmail(account_id.GetUserEmail())); |
| 228 active_user_index_ = 0; | 228 active_user_index_ = 0; |
| 229 for (std::vector<MockUserInfo*>::iterator iter = user_list_.begin(); | 229 for (std::vector<MockUserInfo*>::iterator iter = user_list_.begin(); |
| 230 iter != user_list_.end(); | 230 iter != user_list_.end(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 249 void TestSessionStateDelegate::AddSessionStateObserver( | 249 void TestSessionStateDelegate::AddSessionStateObserver( |
| 250 SessionStateObserver* observer) { | 250 SessionStateObserver* observer) { |
| 251 } | 251 } |
| 252 | 252 |
| 253 void TestSessionStateDelegate::RemoveSessionStateObserver( | 253 void TestSessionStateDelegate::RemoveSessionStateObserver( |
| 254 SessionStateObserver* observer) { | 254 SessionStateObserver* observer) { |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace test | 257 } // namespace test |
| 258 } // namespace ash | 258 } // namespace ash |
| OLD | NEW |