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

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

Issue 11499012: Add policy for limiting the session length (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/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 f34484a599b16c285a83f2f161efdce1b5058f72..ab47a03d6539e01ff2296d1470cfd61e87052de7 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -582,6 +582,12 @@ bool UserManagerImpl::IsSessionStarted() const {
return session_started_;
}
+bool UserManagerImpl::HasBrowserRestarted() const {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ return command_line->HasSwitch(switches::kLoginManager) &&
+ !command_line->HasSwitch(switches::kLoginPassword);
+}
+
bool UserManagerImpl::IsUserNonCryptohomeDataEphemeral(
const std::string& email) const {
// Data belonging to the guest, retail mode and stub users is always
@@ -614,10 +620,7 @@ bool UserManagerImpl::IsUserNonCryptohomeDataEphemeral(
// enabled.
// - or -
// b) The browser is restarting after a crash.
- return AreEphemeralUsersEnabled() ||
- (base::chromeos::IsRunningOnChromeOS() &&
- !CommandLine::ForCurrentProcess()->
- HasSwitch(switches::kLoginManager));
+ return AreEphemeralUsersEnabled() || HasBrowserRestarted();
}
void UserManagerImpl::AddObserver(UserManager::Observer* obs) {

Powered by Google App Engine
This is Rietveld 408576698