Index: chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
index 66e0040228e05c4a94ba025144c91b373f5cb234..f88e8b82e3efd8682ac72b4f06a4b140873356fa 100644 |
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc |
@@ -469,12 +469,13 @@ void ChromeBrowserMainPartsChromeos::PreProfileInit() { |
ChromeBrowserMainPartsLinux::PreProfileInit(); |
if (immediate_login) { |
- const std::string user_id = login::CanonicalizeUserID( |
+ const std::string user_email = login::CanonicalizeUserID( |
parsed_command_line().GetSwitchValueASCII(switches::kLoginUser)); |
user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
- if (policy::IsDeviceLocalAccountUser(user_id, NULL) && |
- !user_manager->IsKnownUser(user_id)) { |
+ const AccountId account_id(AccountId::FromUserEmail(user_email)); |
+ if (policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(), NULL) && |
+ !user_manager->IsKnownUser(account_id)) { |
// When a device-local account is removed, its policy is deleted from disk |
// immediately. If a session using this account happens to be in progress, |
// the session is allowed to continue with policy served from an in-memory |
@@ -488,8 +489,8 @@ void ChromeBrowserMainPartsChromeos::PreProfileInit() { |
// In case of multi-profiles --login-profile will contain user_id_hash. |
std::string user_id_hash = |
parsed_command_line().GetSwitchValueASCII(switches::kLoginProfile); |
- user_manager->UserLoggedIn(user_id, user_id_hash, true); |
- VLOG(1) << "Relaunching browser for user: " << user_id |
+ user_manager->UserLoggedIn(account_id, user_id_hash, true); |
+ VLOG(1) << "Relaunching browser for user: " << user_email |
<< " with hash: " << user_id_hash; |
} |
} |