| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/easy_unlock/bootstrap_user_flow.h" | 5 #include "chrome/browser/chromeos/login/easy_unlock/bootstrap_user_flow.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
| 9 #include "chrome/browser/chromeos/login/easy_unlock/bootstrap_manager.h" | 9 #include "chrome/browser/chromeos/login/easy_unlock/bootstrap_manager.h" |
| 10 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" | 10 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" |
| 11 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 11 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 12 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 12 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 13 #include "chrome/browser/lifetime/application_lifetime.h" | 13 #include "chrome/browser/lifetime/application_lifetime.h" |
| 14 #include "chrome/browser/signin/easy_unlock_service.h" | 14 #include "chrome/browser/signin/easy_unlock_service.h" |
| 15 #include "chrome/browser/signin/easy_unlock_service_regular.h" | 15 #include "chrome/browser/signin/easy_unlock_service_regular.h" |
| 16 #include "components/proximity_auth/screenlock_bridge.h" | 16 #include "components/proximity_auth/screenlock_bridge.h" |
| 17 #include "components/signin/core/account_id/account_id.h" | |
| 18 | 17 |
| 19 namespace chromeos { | 18 namespace chromeos { |
| 20 | 19 |
| 21 BootstrapUserFlow::BootstrapUserFlow(const UserContext& user_context, | 20 BootstrapUserFlow::BootstrapUserFlow(const UserContext& user_context, |
| 22 bool is_new_account) | 21 bool is_new_account) |
| 23 : ExtendedUserFlow(user_context.GetAccountId().GetUserEmail()), | 22 : ExtendedUserFlow(user_context.GetUserID()), |
| 24 user_context_(user_context), | 23 user_context_(user_context), |
| 25 is_new_account_(is_new_account), | 24 is_new_account_(is_new_account), |
| 26 finished_(false), | 25 finished_(false), |
| 27 user_profile_(nullptr), | 26 user_profile_(nullptr), |
| 28 weak_ptr_factory_(this) { | 27 weak_ptr_factory_(this) { |
| 29 ChromeUserManager::Get()->GetBootstrapManager()->AddPendingBootstrap( | 28 ChromeUserManager::Get()->GetBootstrapManager()->AddPendingBootstrap( |
| 30 user_context_.GetAccountId().GetUserEmail()); | 29 user_context_.GetUserID()); |
| 31 } | 30 } |
| 32 | 31 |
| 33 BootstrapUserFlow::~BootstrapUserFlow() { | 32 BootstrapUserFlow::~BootstrapUserFlow() { |
| 34 } | 33 } |
| 35 | 34 |
| 36 void BootstrapUserFlow::StartAutoPairing() { | 35 void BootstrapUserFlow::StartAutoPairing() { |
| 37 DCHECK(user_profile_); | 36 DCHECK(user_profile_); |
| 38 | 37 |
| 39 VLOG(2) << "BootstrapUserFlow StartAutoPairing"; | 38 VLOG(2) << "BootstrapUserFlow StartAutoPairing"; |
| 40 | 39 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 103 |
| 105 void BootstrapUserFlow::OnBootstrapRandomKeyRemoved() { | 104 void BootstrapUserFlow::OnBootstrapRandomKeyRemoved() { |
| 106 Finish(); | 105 Finish(); |
| 107 } | 106 } |
| 108 | 107 |
| 109 void BootstrapUserFlow::Finish() { | 108 void BootstrapUserFlow::Finish() { |
| 110 VLOG(2) << "BootstrapUserFlow::Finish"; | 109 VLOG(2) << "BootstrapUserFlow::Finish"; |
| 111 finished_ = true; | 110 finished_ = true; |
| 112 | 111 |
| 113 ChromeUserManager::Get()->GetBootstrapManager()->FinishPendingBootstrap( | 112 ChromeUserManager::Get()->GetBootstrapManager()->FinishPendingBootstrap( |
| 114 user_context_.GetAccountId().GetUserEmail()); | 113 user_context_.GetUserID()); |
| 115 UserSessionManager::GetInstance()->DoBrowserLaunch(user_profile_, host()); | 114 UserSessionManager::GetInstance()->DoBrowserLaunch(user_profile_, host()); |
| 116 | 115 |
| 117 user_profile_ = nullptr; | 116 user_profile_ = nullptr; |
| 118 UnregisterFlowSoon(); | 117 UnregisterFlowSoon(); |
| 119 } | 118 } |
| 120 | 119 |
| 121 bool BootstrapUserFlow::CanLockScreen() { | 120 bool BootstrapUserFlow::CanLockScreen() { |
| 122 return false; | 121 return false; |
| 123 } | 122 } |
| 124 | 123 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 172 |
| 174 void BootstrapUserFlow::OnAuthenticationFailure( | 173 void BootstrapUserFlow::OnAuthenticationFailure( |
| 175 ExtendedAuthenticator::AuthState state) { | 174 ExtendedAuthenticator::AuthState state) { |
| 176 // TODO(xiyuan): Show error UI. | 175 // TODO(xiyuan): Show error UI. |
| 177 LOG(ERROR) << "Bootstrapped failed because authenticator falure" | 176 LOG(ERROR) << "Bootstrapped failed because authenticator falure" |
| 178 << ", state=" << state; | 177 << ", state=" << state; |
| 179 chrome::AttemptUserExit(); | 178 chrome::AttemptUserExit(); |
| 180 } | 179 } |
| 181 | 180 |
| 182 } // namespace chromeos | 181 } // namespace chromeos |
| OLD | NEW |