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 4edfa2e95fdf3d451562ba526a6cc0b4b57d361c..a4ecb2244f2c32e9bfbe24aaf9c18365e25f2ae5 100644 |
--- a/chrome/browser/chromeos/login/existing_user_controller.cc |
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc |
@@ -24,6 +24,7 @@ |
#include "chrome/browser/chromeos/cros/network_library.h" |
#include "chrome/browser/chromeos/customization_document.h" |
#include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
+#include "chrome/browser/chromeos/dbus/power_manager_client.h" |
#include "chrome/browser/chromeos/dbus/session_manager_client.h" |
#include "chrome/browser/chromeos/login/helper.h" |
#include "chrome/browser/chromeos/login/login_display_host.h" |
@@ -92,6 +93,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-modelogin has failed. |
+const long int kSafeModeRebootDelayMs = 30000; |
+ |
// Makes a call to the policy subsystem to reload the policy when we detect |
// authentication change. |
void RefreshPoliciesOnUIThread() { |
@@ -457,7 +461,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(&PowerManagerClient::RequestRestart, |
Chris Masone
2012/02/24 18:49:45
Is this going to reboot the machine? That's proba
pastarmovj
2012/03/13 15:21:55
True. I changed it to session restart instead whic
|
+ base::Unretained(DBusThreadManager::Get()-> |
+ GetPowerManagerClient())), |
+ kSafeModeRebootDelayMs); |
+ } else if (!online_succeeded_for_.empty()) { |
ShowGaiaPasswordChanged(online_succeeded_for_); |
} else { |
// Check networking after trying to login in case user is |