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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/existing_user_controller.h" 5 #include "chrome/browser/chromeos/login/existing_user_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // accessibility is enabled). 85 // accessibility is enabled).
86 const char kChromeVoxTutorialURLPattern[] = 86 const char kChromeVoxTutorialURLPattern[] =
87 "http://www.chromevox.com/tutorial/index.html?lang=%s"; 87 "http://www.chromevox.com/tutorial/index.html?lang=%s";
88 88
89 // Landing URL when launching Guest mode to fix captive portal. 89 // Landing URL when launching Guest mode to fix captive portal.
90 const char kCaptivePortalLaunchURL[] = "http://www.google.com/"; 90 const char kCaptivePortalLaunchURL[] = "http://www.google.com/";
91 91
92 // Delay for transferring the auth cache to the system profile. 92 // Delay for transferring the auth cache to the system profile.
93 const long int kAuthCacheTransferDelayMs = 2000; 93 const long int kAuthCacheTransferDelayMs = 2000;
94 94
95 // 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.
96 const long int kSafeModeRebootDelayMs = 30000;
97
95 // Makes a call to the policy subsystem to reload the policy when we detect 98 // Makes a call to the policy subsystem to reload the policy when we detect
96 // authentication change. 99 // authentication change.
97 void RefreshPoliciesOnUIThread() { 100 void RefreshPoliciesOnUIThread() {
98 if (g_browser_process->browser_policy_connector()) 101 if (g_browser_process->browser_policy_connector())
99 g_browser_process->browser_policy_connector()->RefreshPolicies(); 102 g_browser_process->browser_policy_connector()->RefreshPolicies();
100 } 103 }
101 104
102 // Copies any authentication details that were entered in the login profile in 105 // Copies any authentication details that were entered in the login profile in
103 // the mail profile to make sure all subsystems of Chrome can access the network 106 // the mail profile to make sure all subsystems of Chrome can access the network
104 // with the provided authentication which are possibly for a proxy server. 107 // with the provided authentication which are possibly for a proxy server.
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 // ExistingUserController, LoginPerformer::Delegate implementation: 468 // ExistingUserController, LoginPerformer::Delegate implementation:
466 // 469 //
467 470
468 void ExistingUserController::OnLoginFailure(const LoginFailure& failure) { 471 void ExistingUserController::OnLoginFailure(const LoginFailure& failure) {
469 is_login_in_progress_ = false; 472 is_login_in_progress_ = false;
470 offline_failed_ = true; 473 offline_failed_ = true;
471 474
472 guest_mode_url_ = GURL::EmptyGURL(); 475 guest_mode_url_ = GURL::EmptyGURL();
473 std::string error = failure.GetErrorString(); 476 std::string error = failure.GetErrorString();
474 477
475 if (!online_succeeded_for_.empty()) { 478 if (failure.reason() == LoginFailure::OWNER_REQUIRED) {
479 ShowError(IDS_LOGIN_ERROR_OWNER_REQUIRED, error);
480 content::BrowserThread::PostDelayedTask(
481 content::BrowserThread::UI, FROM_HERE,
482 base::Bind(&SessionManagerClient::StopSession,
483 base::Unretained(DBusThreadManager::Get()->
484 GetSessionManagerClient())),
485 kSafeModeRebootDelayMs);
486 } else if (!online_succeeded_for_.empty()) {
476 ShowGaiaPasswordChanged(online_succeeded_for_); 487 ShowGaiaPasswordChanged(online_succeeded_for_);
477 } else { 488 } else {
478 // Check networking after trying to login in case user is 489 // Check networking after trying to login in case user is
479 // cached locally or the local admin account. 490 // cached locally or the local admin account.
480 bool is_known_user = 491 bool is_known_user =
481 UserManager::Get()->IsKnownUser(last_login_attempt_username_); 492 UserManager::Get()->IsKnownUser(last_login_attempt_username_);
482 NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary(); 493 NetworkLibrary* network = CrosLibrary::Get()->GetNetworkLibrary();
483 if (!network) { 494 if (!network) {
484 ShowError(IDS_LOGIN_ERROR_NO_NETWORK_LIBRARY, error); 495 ShowError(IDS_LOGIN_ERROR_NO_NETWORK_LIBRARY, error);
485 } else if (!network->Connected()) { 496 } else if (!network->Connected()) {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 // changed. 814 // changed.
804 UserManager::Get()->SaveUserOAuthStatus(username, 815 UserManager::Get()->SaveUserOAuthStatus(username,
805 User::OAUTH_TOKEN_STATUS_INVALID); 816 User::OAUTH_TOKEN_STATUS_INVALID);
806 817
807 login_display_->SetUIEnabled(true); 818 login_display_->SetUIEnabled(true);
808 SetStatusAreaEnabled(true); 819 SetStatusAreaEnabled(true);
809 login_display_->ShowGaiaPasswordChanged(username); 820 login_display_->ShowGaiaPasswordChanged(username);
810 } 821 }
811 822
812 } // namespace chromeos 823 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698