Index: chrome/browser/ui/ash/session_controller_client.cc |
diff --git a/chrome/browser/ui/ash/session_controller_client.cc b/chrome/browser/ui/ash/session_controller_client.cc |
index 38f5b27dfa57803b3a987170f4e03059e1a204c9..978cdc011bad05e708b5f6bbab5881d41c2c6ce9 100644 |
--- a/chrome/browser/ui/ash/session_controller_client.cc |
+++ b/chrome/browser/ui/ash/session_controller_client.cc |
@@ -110,8 +110,8 @@ void SessionControllerClient::SwitchActiveUser(const AccountId& account_id) { |
DoSwitchActiveUser(account_id); |
} |
-void SessionControllerClient::CycleActiveUser(bool next_user) { |
- DoCycleActiveUser(next_user); |
+void SessionControllerClient::CycleActiveUser(ash::CycleUser cycle_user) { |
+ DoCycleActiveUser(cycle_user); |
} |
void SessionControllerClient::ActiveUserChanged(const User* active_user) { |
@@ -197,7 +197,7 @@ void SessionControllerClient::DoSwitchActiveUser(const AccountId& account_id) { |
} |
// static |
-void SessionControllerClient::DoCycleActiveUser(bool next_user) { |
+void SessionControllerClient::DoCycleActiveUser(ash::CycleUser cycle_user) { |
const UserList& logged_in_users = UserManager::Get()->GetLoggedInUsers(); |
if (logged_in_users.size() <= 1) |
return; |
@@ -216,15 +216,18 @@ void SessionControllerClient::DoCycleActiveUser(bool next_user) { |
// Get the user's email to select, wrapping to the start/end of the list if |
// necessary. |
- if (next_user) { |
+ if (cycle_user == ash::CycleUser::CYCLE_TO_NEXT_USER) { |
if (++it == logged_in_users.end()) |
account_id = (*logged_in_users.begin())->GetAccountId(); |
else |
account_id = (*it)->GetAccountId(); |
- } else { |
+ } else if (cycle_user == ash::CycleUser::CYCLE_TO_NEXT_USER) { |
if (it == logged_in_users.begin()) |
it = logged_in_users.end(); |
account_id = (*(--it))->GetAccountId(); |
+ } else { |
+ NOTREACHED() << "Invalid cycle_user=" << static_cast<int>(cycle_user); |
+ return; |
} |
DoSwitchActiveUser(account_id); |