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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 614973002: Extract LoginPerformer to chromeos/auth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Created 6 years, 2 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
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 11 matching lines...) Expand all
22 #include "base/version.h" 22 #include "base/version.h"
23 #include "chrome/browser/accessibility/accessibility_events.h" 23 #include "chrome/browser/accessibility/accessibility_events.h"
24 #include "chrome/browser/browser_process.h" 24 #include "chrome/browser/browser_process.h"
25 #include "chrome/browser/browser_process_platform_part.h" 25 #include "chrome/browser/browser_process_platform_part.h"
26 #include "chrome/browser/chrome_notification_types.h" 26 #include "chrome/browser/chrome_notification_types.h"
27 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 27 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
28 #include "chrome/browser/chromeos/boot_times_loader.h" 28 #include "chrome/browser/chromeos/boot_times_loader.h"
29 #include "chrome/browser/chromeos/customization_document.h" 29 #include "chrome/browser/chromeos/customization_document.h"
30 #include "chrome/browser/chromeos/first_run/first_run.h" 30 #include "chrome/browser/chromeos/first_run/first_run.h"
31 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" 31 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
32 #include "chrome/browser/chromeos/login/auth/chrome_login_performer.h"
32 #include "chrome/browser/chromeos/login/helper.h" 33 #include "chrome/browser/chromeos/login/helper.h"
33 #include "chrome/browser/chromeos/login/login_utils.h" 34 #include "chrome/browser/chromeos/login/login_utils.h"
34 #include "chrome/browser/chromeos/login/startup_utils.h" 35 #include "chrome/browser/chromeos/login/startup_utils.h"
35 #include "chrome/browser/chromeos/login/ui/login_display_host.h" 36 #include "chrome/browser/chromeos/login/ui/login_display_host.h"
36 #include "chrome/browser/chromeos/login/user_flow.h" 37 #include "chrome/browser/chromeos/login/user_flow.h"
37 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" 38 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
38 #include "chrome/browser/chromeos/login/wizard_controller.h" 39 #include "chrome/browser/chromeos/login/wizard_controller.h"
39 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 40 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
40 #include "chrome/browser/chromeos/policy/device_local_account.h" 41 #include "chrome/browser/chromeos/policy/device_local_account.h"
41 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" 42 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 BootTimesLoader::Get()->RecordLoginAttempted(); 453 BootTimesLoader::Get()->RecordLoginAttempted();
453 454
454 // Disable UI while loading user profile. 455 // Disable UI while loading user profile.
455 login_display_->SetUIEnabled(false); 456 login_display_->SetUIEnabled(false);
456 457
457 // Use the same LoginPerformer for subsequent login as it has state 458 // Use the same LoginPerformer for subsequent login as it has state
458 // such as Authenticator instance. 459 // such as Authenticator instance.
459 if (!login_performer_.get() || num_login_attempts_ <= 1) { 460 if (!login_performer_.get() || num_login_attempts_ <= 1) {
460 // Only one instance of LoginPerformer should exist at a time. 461 // Only one instance of LoginPerformer should exist at a time.
461 login_performer_.reset(NULL); 462 login_performer_.reset(NULL);
462 login_performer_.reset(new LoginPerformer(this)); 463 login_performer_.reset(new ChromeLoginPerformer(this));
463 } 464 }
464 465
465 is_login_in_progress_ = true; 466 is_login_in_progress_ = true;
466 if (gaia::ExtractDomainName(user_context.GetUserID()) == 467 if (gaia::ExtractDomainName(user_context.GetUserID()) ==
467 chromeos::login::kSupervisedUserDomain) { 468 chromeos::login::kSupervisedUserDomain) {
468 login_performer_->LoginAsSupervisedUser(user_context); 469 login_performer_->LoginAsSupervisedUser(user_context);
469 } else { 470 } else {
470 login_performer_->PerformLogin(user_context, auth_mode); 471 login_performer_->PerformLogin(user_context, auth_mode);
471 } 472 }
472 SendAccessibilityAlert( 473 SendAccessibilityAlert(
473 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNING_IN)); 474 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNING_IN));
474 } 475 }
475 476
476 void ExistingUserController::LoginAsRetailModeUser() { 477 void ExistingUserController::LoginAsRetailModeUser() {
477 // Stop the auto-login timer when attempting login. 478 // Stop the auto-login timer when attempting login.
478 StopPublicSessionAutoLoginTimer(); 479 StopPublicSessionAutoLoginTimer();
479 480
480 // Disable clicking on other windows. 481 // Disable clicking on other windows.
481 login_display_->SetUIEnabled(false); 482 login_display_->SetUIEnabled(false);
482 // TODO(rkc): Add a CHECK to make sure retail mode logins are allowed once 483 // TODO(rkc): Add a CHECK to make sure retail mode logins are allowed once
483 // the enterprise policy wiring is done for retail mode. 484 // the enterprise policy wiring is done for retail mode.
484 485
485 // Only one instance of LoginPerformer should exist at a time. 486 // Only one instance of LoginPerformer should exist at a time.
486 login_performer_.reset(NULL); 487 login_performer_.reset(NULL);
487 login_performer_.reset(new LoginPerformer(this)); 488 login_performer_.reset(new ChromeLoginPerformer(this));
488 is_login_in_progress_ = true; 489 is_login_in_progress_ = true;
489 login_performer_->LoginRetailMode(); 490 login_performer_->LoginRetailMode();
490 SendAccessibilityAlert( 491 SendAccessibilityAlert(
491 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_DEMOUSER)); 492 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_DEMOUSER));
492 } 493 }
493 494
494 void ExistingUserController::LoginAsGuest() { 495 void ExistingUserController::LoginAsGuest() {
495 if (is_login_in_progress_ || 496 if (is_login_in_progress_ ||
496 user_manager::UserManager::Get()->IsUserLoggedIn()) { 497 user_manager::UserManager::Get()->IsUserLoggedIn()) {
497 return; 498 return;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT); 533 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT);
533 // Reenable clicking on other windows and status area. 534 // Reenable clicking on other windows and status area.
534 login_display_->SetUIEnabled(true); 535 login_display_->SetUIEnabled(true);
535 StartPublicSessionAutoLoginTimer(); 536 StartPublicSessionAutoLoginTimer();
536 display_email_.clear(); 537 display_email_.clear();
537 return; 538 return;
538 } 539 }
539 540
540 // Only one instance of LoginPerformer should exist at a time. 541 // Only one instance of LoginPerformer should exist at a time.
541 login_performer_.reset(NULL); 542 login_performer_.reset(NULL);
542 login_performer_.reset(new LoginPerformer(this)); 543 login_performer_.reset(new ChromeLoginPerformer(this));
543 is_login_in_progress_ = true; 544 is_login_in_progress_ = true;
544 login_performer_->LoginOffTheRecord(); 545 login_performer_->LoginOffTheRecord();
545 SendAccessibilityAlert( 546 SendAccessibilityAlert(
546 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_OFFRECORD)); 547 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_OFFRECORD));
547 } 548 }
548 549
549 void ExistingUserController::MigrateUserData(const std::string& old_password) { 550 void ExistingUserController::MigrateUserData(const std::string& old_password) {
550 // LoginPerformer instance has state of the user so it should exist. 551 // LoginPerformer instance has state of the user so it should exist.
551 if (login_performer_.get()) 552 if (login_performer_.get())
552 login_performer_->RecoverEncryptedData(old_password); 553 login_performer_->RecoverEncryptedData(old_password);
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 DCHECK(!keyboard_layout.empty()); 1247 DCHECK(!keyboard_layout.empty());
1247 new_user_context.SetPublicSessionInputMethod(keyboard_layout); 1248 new_user_context.SetPublicSessionInputMethod(keyboard_layout);
1248 1249
1249 LoginAsPublicSessionInternal(new_user_context); 1250 LoginAsPublicSessionInternal(new_user_context);
1250 } 1251 }
1251 1252
1252 void ExistingUserController::LoginAsPublicSessionInternal( 1253 void ExistingUserController::LoginAsPublicSessionInternal(
1253 const UserContext& user_context) { 1254 const UserContext& user_context) {
1254 // Only one instance of LoginPerformer should exist at a time. 1255 // Only one instance of LoginPerformer should exist at a time.
1255 login_performer_.reset(NULL); 1256 login_performer_.reset(NULL);
1256 login_performer_.reset(new LoginPerformer(this)); 1257 login_performer_.reset(new ChromeLoginPerformer(this));
1257 is_login_in_progress_ = true; 1258 is_login_in_progress_ = true;
1258 login_performer_->LoginAsPublicSession(user_context); 1259 login_performer_->LoginAsPublicSession(user_context);
1259 SendAccessibilityAlert( 1260 SendAccessibilityAlert(
1260 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_PUBLIC_ACCOUNT)); 1261 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_PUBLIC_ACCOUNT));
1261 } 1262 }
1262 1263
1263 } // namespace chromeos 1264 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698