OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 bool pending_requests) { | 491 bool pending_requests) { |
492 // LoginPerformer instance will delete itself once online auth result is OK. | 492 // LoginPerformer instance will delete itself once online auth result is OK. |
493 // In case of failure it'll bring up ScreenLock and ask for | 493 // In case of failure it'll bring up ScreenLock and ask for |
494 // correct password/display error message. | 494 // correct password/display error message. |
495 // Even in case when following online,offline protocol and returning | 495 // Even in case when following online,offline protocol and returning |
496 // requests_pending = false, let LoginPerformer delete itself. | 496 // requests_pending = false, let LoginPerformer delete itself. |
497 login_performer_->set_delegate(NULL); | 497 login_performer_->set_delegate(NULL); |
498 LoginPerformer* performer = login_performer_.release(); | 498 LoginPerformer* performer = login_performer_.release(); |
499 performer = NULL; | 499 performer = NULL; |
500 bool known_user = UserManager::Get()->IsKnownUser(username); | 500 bool known_user = UserManager::Get()->IsKnownUser(username); |
501 if (credentials.two_factor && !known_user && !start_url_.is_valid()) { | |
502 // If we have a two factor error and and this is a new user and we are not | |
503 // already directing the user to a start url (e.g. a help page), | |
504 // direct them to the personal settings page. | |
505 // TODO(stevenjb): direct the user to a lightweight sync login page. | |
506 start_url_ = GURL(kSettingsSyncLoginUrl); | |
507 } | |
508 AppendStartUrlToCmdline(); | 501 AppendStartUrlToCmdline(); |
509 if (selected_view_index_ + 1 == controllers_.size() && !known_user) { | 502 if (selected_view_index_ + 1 == controllers_.size() && !known_user) { |
510 #if defined(OFFICIAL_BUILD) | 503 #if defined(OFFICIAL_BUILD) |
511 CommandLine::ForCurrentProcess()->AppendSwitchPath( | 504 CommandLine::ForCurrentProcess()->AppendSwitchPath( |
512 switches::kLoadExtension, | 505 switches::kLoadExtension, |
513 FilePath(kGetStartedPath)); | 506 FilePath(kGetStartedPath)); |
514 CommandLine::ForCurrentProcess()->AppendArg(kGetStartedURL); | 507 CommandLine::ForCurrentProcess()->AppendArg(kGetStartedURL); |
515 #endif // OFFICIAL_BUILD | 508 #endif // OFFICIAL_BUILD |
| 509 if (credentials.two_factor) { |
| 510 // If we have a two factor error and and this is a new user and we are not |
| 511 // already directing the user to a start url (e.g. a help page), |
| 512 // direct them to the personal settings page. |
| 513 // TODO(stevenjb): direct the user to a lightweight sync login page. |
| 514 CommandLine::ForCurrentProcess()->AppendArg(kSettingsSyncLoginUrl); |
| 515 } |
516 // For new user login don't launch browser until we pass image screen. | 516 // For new user login don't launch browser until we pass image screen. |
517 LoginUtils::Get()->EnableBrowserLaunch(false); | 517 LoginUtils::Get()->EnableBrowserLaunch(false); |
518 LoginUtils::Get()->CompleteLogin(username, password, credentials); | 518 LoginUtils::Get()->CompleteLogin(username, password, credentials); |
519 ActivateWizard(WizardController::IsDeviceRegistered() ? | 519 ActivateWizard(WizardController::IsDeviceRegistered() ? |
520 WizardController::kUserImageScreenName : | 520 WizardController::kUserImageScreenName : |
521 WizardController::kRegistrationScreenName); | 521 WizardController::kRegistrationScreenName); |
522 } else { | 522 } else { |
523 // Hide the login windows now. | 523 // Hide the login windows now. |
524 WmIpc::Message message(WM_IPC_MESSAGE_WM_HIDE_LOGIN); | 524 WmIpc::Message message(WM_IPC_MESSAGE_WM_HIDE_LOGIN); |
525 WmIpc::instance()->SendMessage(message); | 525 WmIpc::instance()->SendMessage(message); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 void ExistingUserController::RecoverEncryptedData( | 594 void ExistingUserController::RecoverEncryptedData( |
595 const std::string& old_password) { | 595 const std::string& old_password) { |
596 login_performer_->RecoverEncryptedData(old_password); | 596 login_performer_->RecoverEncryptedData(old_password); |
597 } | 597 } |
598 | 598 |
599 void ExistingUserController::ResyncEncryptedData() { | 599 void ExistingUserController::ResyncEncryptedData() { |
600 login_performer_->ResyncEncryptedData(); | 600 login_performer_->ResyncEncryptedData(); |
601 } | 601 } |
602 | 602 |
603 } // namespace chromeos | 603 } // namespace chromeos |
OLD | NEW |