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

Unified Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Fix Win GN build. Created 5 years, 1 month 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/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;
}
}

Powered by Google App Engine
This is Rietveld 408576698