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