Index: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
index 9ab2c5be9fefa0654898d09ff3a63a6826f138aa..e1c09dd568f5a772729914398f8da62008bbd75c 100644 |
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
@@ -1373,9 +1373,18 @@ void SigninScreenHandler::SendUserList(bool animated) { |
ListValue users_list; |
const UserList& users = delegate_->GetUsers(); |
+ // TODO(nkostylev): Move to a separate method in UserManager. |
+ bool is_signin_to_add = BaseLoginDisplayHost::default_host() && |
+ UserManager::Get()->IsUserLoggedIn(); |
+ |
bool single_user = users.size() == 1; |
for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { |
const std::string& email = (*it)->email(); |
+ if (is_signin_to_add && (*it)->is_logged_in()) { |
+ // Skip all users that are already signed in. |
+ continue; |
+ } |
+ |
std::string owner; |
chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner); |
bool is_owner = (email == owner); |
@@ -1394,7 +1403,8 @@ void SigninScreenHandler::SendUserList(bool animated) { |
!email.empty() && |
!is_owner && |
!is_public_account && |
- !signed_in); |
+ !signed_in && |
+ !is_signin_to_add); |
users_list.Append(user_dict); |
if (!is_owner) |