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

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

Issue 150203002: Public pods move to the beginning of user list on sign-in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a2ee971997055708135ec50371d0e6948c985167..7f6b859e5408b9e071ca9016cc252cf41b7c8294 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -1227,6 +1227,7 @@ void SigninScreenHandler::SendUserList(bool animated) {
size_t non_owner_count = 0;
base::ListValue users_list;
+ size_t first_non_public_account_index = 0;
const UserList& users = delegate_->GetUsers();
// TODO(nkostylev): Move to a separate method in UserManager.
@@ -1235,11 +1236,10 @@ void SigninScreenHandler::SendUserList(bool animated) {
UserManager::Get()->IsUserLoggedIn();
bool single_user = users.size() == 1;
+ std::string owner;
+ chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner);
for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) {
const std::string& email = (*it)->email();
-
- std::string owner;
- chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner);
bool is_owner = (email == owner);
if (non_owner_count < max_non_owner_users || is_owner) {
@@ -1259,7 +1259,11 @@ void SigninScreenHandler::SendUserList(bool animated) {
!signed_in &&
!is_signin_to_add);
- users_list.Append(user_dict);
+ // public accounts come first in the list
+ if (is_public_account)
+ users_list.Insert(first_non_public_account_index++, user_dict);
+ else
+ users_list.Append(user_dict);
if (!is_owner)
++non_owner_count;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698