OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 if (WizardController::IsDeviceRegistered()) { | 586 if (WizardController::IsDeviceRegistered()) { |
587 LoginUtils::Get()->CompleteOffTheRecordLogin(start_url_); | 587 LoginUtils::Get()->CompleteOffTheRecordLogin(start_url_); |
588 } else { | 588 } else { |
589 // Postpone CompleteOffTheRecordLogin until registration completion. | 589 // Postpone CompleteOffTheRecordLogin until registration completion. |
590 ActivateWizard(WizardController::kRegistrationScreenName); | 590 ActivateWizard(WizardController::kRegistrationScreenName); |
591 } | 591 } |
592 } | 592 } |
593 | 593 |
594 void ExistingUserController::OnPasswordChangeDetected( | 594 void ExistingUserController::OnPasswordChangeDetected( |
595 const GaiaAuthConsumer::ClientLoginResult& credentials) { | 595 const GaiaAuthConsumer::ClientLoginResult& credentials) { |
596 // When signing in as a "New user" always remove old cryptohome. | |
597 if (selected_view_index_ == controllers_.size() - 1) { | |
598 ResyncEncryptedData(); | |
599 return; | |
600 } | |
601 | |
602 // Must not proceed without signature verification. | 596 // Must not proceed without signature verification. |
603 bool trusted_setting_available = user_settings_->RequestTrustedOwner( | 597 bool trusted_setting_available = user_settings_->RequestTrustedOwner( |
604 method_factory_.NewRunnableMethod( | 598 method_factory_.NewRunnableMethod( |
605 &ExistingUserController::OnPasswordChangeDetected, | 599 &ExistingUserController::OnPasswordChangeDetected, |
606 credentials)); | 600 credentials)); |
607 if (!trusted_setting_available) { | 601 if (!trusted_setting_available) { |
608 // Value of owner email is still not verified. | 602 // Value of owner email is still not verified. |
609 // Another attempt will be invoked after verification completion. | 603 // Another attempt will be invoked after verification completion. |
610 return; | 604 return; |
611 } | 605 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 login_performer_->RecoverEncryptedData(old_password); | 652 login_performer_->RecoverEncryptedData(old_password); |
659 } | 653 } |
660 | 654 |
661 void ExistingUserController::ResyncEncryptedData() { | 655 void ExistingUserController::ResyncEncryptedData() { |
662 // LoginPerformer instance has state of the user so it should exist. | 656 // LoginPerformer instance has state of the user so it should exist. |
663 if (login_performer_.get()) | 657 if (login_performer_.get()) |
664 login_performer_->ResyncEncryptedData(); | 658 login_performer_->ResyncEncryptedData(); |
665 } | 659 } |
666 | 660 |
667 } // namespace chromeos | 661 } // namespace chromeos |
OLD | NEW |