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

Unified Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 10382086: Determine whether user is ephemeral when coming back from a crash (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Radically simpler fix for the issue. Created 8 years, 7 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/chromeos/login/user_manager_impl.cc
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc
index b733b40987562fe09720dcf467ed36f495b67bb6..383d242bdb71e8bb5f97aaf95a56568a177e308e 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -900,11 +900,16 @@ bool UserManagerImpl::IsEphemeralUser(const std::string& email) const {
if (logged_in_user_ && (email == logged_in_user_->email()))
return is_current_user_ephemeral_;
- // Any other user is ephemeral iff ephemeral users are enabled, the user is
- // not the owner and is not in the persistent list.
- return AreEphemeralUsersEnabled() &&
- (email != owner_email_) &&
- !FindUserInList(email);
+ // The owner and any users found in the persistent list are never ephemeral.
+ if (email == owner_email_ || FindUserInList(email))
+ return false;
+
+ // Any other user is ephemeral when:
+ // a) Going through the regular login flow and ephemeral users are enabled.
+ // - or -
+ // b) The browser is restarting after a crash.
+ return AreEphemeralUsersEnabled() ||
+ !CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager);
}
const User* UserManagerImpl::FindUserInList(const std::string& email) const {
« 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