| OLD | NEW |
| 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 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 // correct password/display error message. | 689 // correct password/display error message. |
| 690 // Even in case when following online,offline protocol and returning | 690 // Even in case when following online,offline protocol and returning |
| 691 // requests_pending = false, let LoginPerformer delete itself. | 691 // requests_pending = false, let LoginPerformer delete itself. |
| 692 login_performer_->set_delegate(NULL); | 692 login_performer_->set_delegate(NULL); |
| 693 ignore_result(login_performer_.release()); | 693 ignore_result(login_performer_.release()); |
| 694 | 694 |
| 695 // Will call OnProfilePrepared() in the end. | 695 // Will call OnProfilePrepared() in the end. |
| 696 LoginUtils::Get()->PrepareProfile(username, | 696 LoginUtils::Get()->PrepareProfile(username, |
| 697 display_email_, | 697 display_email_, |
| 698 password, | 698 password, |
| 699 pending_requests, | |
| 700 using_oauth, | 699 using_oauth, |
| 701 has_cookies, | 700 has_cookies, |
| 702 this); | 701 this); |
| 703 | 702 |
| 704 display_email_.clear(); | 703 display_email_.clear(); |
| 705 | 704 |
| 706 // Notify LoginDisplay to allow it provide visual feedback to user. | 705 // Notify LoginDisplay to allow it provide visual feedback to user. |
| 707 login_display_->OnLoginSuccess(username); | 706 login_display_->OnLoginSuccess(username); |
| 708 } | 707 } |
| 709 | 708 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 break; | 990 break; |
| 992 } | 991 } |
| 993 | 992 |
| 994 login_display_->ShowError(error_id, num_login_attempts_, help_topic_id); | 993 login_display_->ShowError(error_id, num_login_attempts_, help_topic_id); |
| 995 } | 994 } |
| 996 | 995 |
| 997 void ExistingUserController::ShowGaiaPasswordChanged( | 996 void ExistingUserController::ShowGaiaPasswordChanged( |
| 998 const std::string& username) { | 997 const std::string& username) { |
| 999 // Invalidate OAuth token, since it can't be correct after password is | 998 // Invalidate OAuth token, since it can't be correct after password is |
| 1000 // changed. | 999 // changed. |
| 1001 UserManager::Get()->SaveUserOAuthStatus(username, | 1000 UserManager::Get()->SaveUserOAuthStatus( |
| 1002 User::OAUTH_TOKEN_STATUS_INVALID); | 1001 username, |
| 1002 CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceOAuth1) ? |
| 1003 User::OAUTH1_TOKEN_STATUS_INVALID : |
| 1004 User::OAUTH2_TOKEN_STATUS_INVALID); |
| 1003 | 1005 |
| 1004 login_display_->SetUIEnabled(true); | 1006 login_display_->SetUIEnabled(true); |
| 1005 login_display_->ShowGaiaPasswordChanged(username); | 1007 login_display_->ShowGaiaPasswordChanged(username); |
| 1006 } | 1008 } |
| 1007 | 1009 |
| 1008 } // namespace chromeos | 1010 } // namespace chromeos |
| OLD | NEW |