| 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" | 17 #include "components/signin/core/account_id/account_id.h" |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 | 20 |
| 21 BootstrapUserFlow::BootstrapUserFlow(const UserContext& user_context, | 21 BootstrapUserFlow::BootstrapUserFlow(const UserContext& user_context, |
| 22 bool is_new_account) | 22 bool is_new_account) |
| 23 : ExtendedUserFlow(user_context.GetAccountId().GetUserEmail()), | 23 : ExtendedUserFlow(user_context.GetAccountId()), |
| 24 user_context_(user_context), | 24 user_context_(user_context), |
| 25 is_new_account_(is_new_account), | 25 is_new_account_(is_new_account), |
| 26 finished_(false), | 26 finished_(false), |
| 27 user_profile_(nullptr), | 27 user_profile_(nullptr), |
| 28 weak_ptr_factory_(this) { | 28 weak_ptr_factory_(this) { |
| 29 ChromeUserManager::Get()->GetBootstrapManager()->AddPendingBootstrap( | 29 ChromeUserManager::Get()->GetBootstrapManager()->AddPendingBootstrap( |
| 30 user_context_.GetAccountId().GetUserEmail()); | 30 user_context_.GetAccountId()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 BootstrapUserFlow::~BootstrapUserFlow() { | 33 BootstrapUserFlow::~BootstrapUserFlow() { |
| 34 } | 34 } |
| 35 | 35 |
| 36 void BootstrapUserFlow::StartAutoPairing() { | 36 void BootstrapUserFlow::StartAutoPairing() { |
| 37 DCHECK(user_profile_); | 37 DCHECK(user_profile_); |
| 38 | 38 |
| 39 VLOG(2) << "BootstrapUserFlow StartAutoPairing"; | 39 VLOG(2) << "BootstrapUserFlow StartAutoPairing"; |
| 40 | 40 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 void BootstrapUserFlow::OnBootstrapRandomKeyRemoved() { | 105 void BootstrapUserFlow::OnBootstrapRandomKeyRemoved() { |
| 106 Finish(); | 106 Finish(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void BootstrapUserFlow::Finish() { | 109 void BootstrapUserFlow::Finish() { |
| 110 VLOG(2) << "BootstrapUserFlow::Finish"; | 110 VLOG(2) << "BootstrapUserFlow::Finish"; |
| 111 finished_ = true; | 111 finished_ = true; |
| 112 | 112 |
| 113 ChromeUserManager::Get()->GetBootstrapManager()->FinishPendingBootstrap( | 113 ChromeUserManager::Get()->GetBootstrapManager()->FinishPendingBootstrap( |
| 114 user_context_.GetAccountId().GetUserEmail()); | 114 user_context_.GetAccountId()); |
| 115 UserSessionManager::GetInstance()->DoBrowserLaunch(user_profile_, host()); | 115 UserSessionManager::GetInstance()->DoBrowserLaunch(user_profile_, host()); |
| 116 | 116 |
| 117 user_profile_ = nullptr; | 117 user_profile_ = nullptr; |
| 118 UnregisterFlowSoon(); | 118 UnregisterFlowSoon(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 bool BootstrapUserFlow::CanLockScreen() { | 121 bool BootstrapUserFlow::CanLockScreen() { |
| 122 return false; | 122 return false; |
| 123 } | 123 } |
| 124 | 124 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 void BootstrapUserFlow::OnAuthenticationFailure( | 174 void BootstrapUserFlow::OnAuthenticationFailure( |
| 175 ExtendedAuthenticator::AuthState state) { | 175 ExtendedAuthenticator::AuthState state) { |
| 176 // TODO(xiyuan): Show error UI. | 176 // TODO(xiyuan): Show error UI. |
| 177 LOG(ERROR) << "Bootstrapped failed because authenticator falure" | 177 LOG(ERROR) << "Bootstrapped failed because authenticator falure" |
| 178 << ", state=" << state; | 178 << ", state=" << state; |
| 179 chrome::AttemptUserExit(); | 179 chrome::AttemptUserExit(); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace chromeos | 182 } // namespace chromeos |
| OLD | NEW |