Chromium Code Reviews| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 | 224 |
| 225 const user_manager::UserInfo* TestSessionStateDelegate::GetUserInfo( | 225 const user_manager::UserInfo* TestSessionStateDelegate::GetUserInfo( |
| 226 content::BrowserContext* context) const { | 226 content::BrowserContext* context) const { |
| 227 return user_list_[active_user_index_]; | 227 return user_list_[active_user_index_]; |
| 228 } | 228 } |
| 229 | 229 |
| 230 bool TestSessionStateDelegate::ShouldShowAvatar(aura::Window* window) const { | 230 bool TestSessionStateDelegate::ShouldShowAvatar(aura::Window* window) const { |
| 231 return !GetActiveUserInfo()->GetImage().isNull(); | 231 return !GetActiveUserInfo()->GetImage().isNull(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 void TestSessionStateDelegate::SwitchActiveUser(const std::string& user_id) { | 234 void TestSessionStateDelegate::SwitchActiveUser(const user_manager::UserID& user _id) { |
| 235 // Make sure this is a user id and not an email address. | 235 // Make sure this is a user id and not an email address. |
| 236 EXPECT_EQ(user_id, GetUserIDFromEmail(user_id)); | 236 EXPECT_EQ(user_id.GetUserEmail(), GetUserIDFromEmail(user_id.GetUserEmail())); |
|
Denis Kuznetsov (DE-MUC)
2015/06/10 16:50:46
No need for this check here. This check should be
| |
| 237 active_user_index_ = 0; | 237 active_user_index_ = 0; |
| 238 for (std::vector<MockUserInfo*>::iterator iter = user_list_.begin(); | 238 for (std::vector<MockUserInfo*>::iterator iter = user_list_.begin(); |
| 239 iter != user_list_.end(); | 239 iter != user_list_.end(); |
| 240 ++iter) { | 240 ++iter) { |
| 241 if ((*iter)->GetUserID() == user_id) { | 241 if ((*iter)->GetUserID() == user_id) { |
| 242 active_user_index_ = iter - user_list_.begin(); | 242 active_user_index_ = iter - user_list_.begin(); |
| 243 return; | 243 return; |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 NOTREACHED() << "Unknown user:" << user_id; | 246 NOTREACHED() << "Unknown user:" << user_id; |
| 247 } | 247 } |
| 248 | 248 |
| 249 void TestSessionStateDelegate::CycleActiveUser(CycleUser cycle_user) { | 249 void TestSessionStateDelegate::CycleActiveUser(CycleUser cycle_user) { |
| 250 SwitchActiveUser("someone@tray"); | 250 SwitchActiveUser(user_manager::UserID(std::string(), "someone@tray")); |
|
Denis Kuznetsov (DE-MUC)
2015/06/10 16:50:46
FromUserEmail()
| |
| 251 } | 251 } |
| 252 | 252 |
| 253 bool TestSessionStateDelegate::IsMultiProfileAllowedByPrimaryUserPolicy() | 253 bool TestSessionStateDelegate::IsMultiProfileAllowedByPrimaryUserPolicy() |
| 254 const { | 254 const { |
| 255 return true; | 255 return true; |
| 256 } | 256 } |
| 257 | 257 |
| 258 void TestSessionStateDelegate::AddSessionStateObserver( | 258 void TestSessionStateDelegate::AddSessionStateObserver( |
| 259 SessionStateObserver* observer) { | 259 SessionStateObserver* observer) { |
| 260 } | 260 } |
| 261 | 261 |
| 262 void TestSessionStateDelegate::RemoveSessionStateObserver( | 262 void TestSessionStateDelegate::RemoveSessionStateObserver( |
| 263 SessionStateObserver* observer) { | 263 SessionStateObserver* observer) { |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace test | 266 } // namespace test |
| 267 } // namespace ash | 267 } // namespace ash |
| OLD | NEW |