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

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: Update after review. Created 5 years, 2 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/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 d9ccf5c9a90061475a03a66a5d4cbb520f46920a..1e844704e5f111b8df43ed9e52d6ca73693d1cd6 100644
--- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
+++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -468,12 +468,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
@@ -487,8 +488,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