Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7669)

Unified Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 14139003: Chrome OS multi-profiles backend and UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698