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

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

Issue 9466005: Make sure the device recovers from policy loss in the consumer case. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on ToT and cleaned up comments and unrelated changes. Created 8 years, 9 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/login/existing_user_controller.cc
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index 19daaf962027f1a5bc413e7e071c762136f4f29e..984fbfea6b908b724668dcc8242180f01962b8a0 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -92,6 +92,9 @@ const char kCaptivePortalLaunchURL[] = "http://www.google.com/";
// Delay for transferring the auth cache to the system profile.
const long int kAuthCacheTransferDelayMs = 2000;
+// Delay for rebooting the machine if safe-mode login has failed.
Chris Masone 2012/03/22 16:18:25 s/reboot/logout/ Or something that's not 'reboot'
pastarmovj 2012/03/23 13:00:25 Done.
+const long int kSafeModeRebootDelayMs = 30000;
+
// Makes a call to the policy subsystem to reload the policy when we detect
// authentication change.
void RefreshPoliciesOnUIThread() {
@@ -472,7 +475,15 @@ void ExistingUserController::OnLoginFailure(const LoginFailure& failure) {
guest_mode_url_ = GURL::EmptyGURL();
std::string error = failure.GetErrorString();
- if (!online_succeeded_for_.empty()) {
+ if (failure.reason() == LoginFailure::OWNER_REQUIRED) {
+ ShowError(IDS_LOGIN_ERROR_OWNER_REQUIRED, error);
+ content::BrowserThread::PostDelayedTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(&SessionManagerClient::StopSession,
+ base::Unretained(DBusThreadManager::Get()->
+ GetSessionManagerClient())),
+ kSafeModeRebootDelayMs);
+ } else if (!online_succeeded_for_.empty()) {
ShowGaiaPasswordChanged(online_succeeded_for_);
} else {
// Check networking after trying to login in case user is

Powered by Google App Engine
This is Rietveld 408576698