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

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: move IsMultiProfilesEnabled() out of cros 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
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/oobe_ui.cc ('k') | chrome/common/chrome_notification_types.h » ('j') | 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 9ab2c5be9fefa0654898d09ff3a63a6826f138aa..fa2b4466f5f117fad7c990c97c50ea7fb1478001 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,22 @@ void SigninScreenHandler::SendUserList(bool animated) {
ListValue users_list;
const UserList& users = delegate_->GetUsers();
+ // TODO(nkostylev): Show optional intro dialog about multi-profiles feature
+ // based on user preferences. http://crbug.com/230862
+
+ // TODO(nkostylev): Move to a separate method in UserManager.
+ // http://crbug.com/230852
+ 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 +1407,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)
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/oobe_ui.cc ('k') | chrome/common/chrome_notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698