| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/easy_unlock_user_login_flow.
h" | 5 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_user_login_flow.
h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 7 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 8 #include "chrome/browser/signin/easy_unlock_service.h" | 8 #include "chrome/browser/signin/easy_unlock_service.h" |
| 9 | 9 |
| 10 EasyUnlockUserLoginFlow::EasyUnlockUserLoginFlow(const std::string& user_id) | 10 EasyUnlockUserLoginFlow::EasyUnlockUserLoginFlow(const AccountId& account_id) |
| 11 : chromeos::ExtendedUserFlow(user_id) { | 11 : chromeos::ExtendedUserFlow(account_id) {} |
| 12 } | |
| 13 | 12 |
| 14 EasyUnlockUserLoginFlow::~EasyUnlockUserLoginFlow() {} | 13 EasyUnlockUserLoginFlow::~EasyUnlockUserLoginFlow() {} |
| 15 | 14 |
| 16 bool EasyUnlockUserLoginFlow::CanLockScreen() { | 15 bool EasyUnlockUserLoginFlow::CanLockScreen() { |
| 17 return true; | 16 return true; |
| 18 } | 17 } |
| 19 | 18 |
| 20 bool EasyUnlockUserLoginFlow::ShouldLaunchBrowser() { | 19 bool EasyUnlockUserLoginFlow::ShouldLaunchBrowser() { |
| 21 return true; | 20 return true; |
| 22 } | 21 } |
| 23 | 22 |
| 24 bool EasyUnlockUserLoginFlow::ShouldSkipPostLoginScreens() { | 23 bool EasyUnlockUserLoginFlow::ShouldSkipPostLoginScreens() { |
| 25 return false; | 24 return false; |
| 26 } | 25 } |
| 27 | 26 |
| 28 bool EasyUnlockUserLoginFlow::HandleLoginFailure( | 27 bool EasyUnlockUserLoginFlow::HandleLoginFailure( |
| 29 const chromeos::AuthFailure& failure) { | 28 const chromeos::AuthFailure& failure) { |
| 30 Profile* profile = chromeos::ProfileHelper::GetSigninProfile(); | 29 Profile* profile = chromeos::ProfileHelper::GetSigninProfile(); |
| 31 EasyUnlockService* service = EasyUnlockService::Get(profile); | 30 EasyUnlockService* service = EasyUnlockService::Get(profile); |
| 32 if (!service) | 31 if (!service) |
| 33 return false; | 32 return false; |
| 34 service->HandleAuthFailure(user_id()); | 33 service->HandleAuthFailure(account_id()); |
| 35 service->RecordEasySignInOutcome(user_id(), false); | 34 service->RecordEasySignInOutcome(account_id(), false); |
| 36 UnregisterFlowSoon(); | 35 UnregisterFlowSoon(); |
| 37 return true; | 36 return true; |
| 38 } | 37 } |
| 39 | 38 |
| 40 void EasyUnlockUserLoginFlow::HandleLoginSuccess( | 39 void EasyUnlockUserLoginFlow::HandleLoginSuccess( |
| 41 const chromeos::UserContext& context) { | 40 const chromeos::UserContext& context) { |
| 42 Profile* profile = chromeos::ProfileHelper::GetSigninProfile(); | 41 Profile* profile = chromeos::ProfileHelper::GetSigninProfile(); |
| 43 EasyUnlockService* service = EasyUnlockService::Get(profile); | 42 EasyUnlockService* service = EasyUnlockService::Get(profile); |
| 44 if (!service) | 43 if (!service) |
| 45 return; | 44 return; |
| 46 service->RecordEasySignInOutcome(user_id(), true); | 45 service->RecordEasySignInOutcome(account_id(), true); |
| 47 } | 46 } |
| 48 | 47 |
| 49 bool EasyUnlockUserLoginFlow::HandlePasswordChangeDetected() { | 48 bool EasyUnlockUserLoginFlow::HandlePasswordChangeDetected() { |
| 50 return false; | 49 return false; |
| 51 } | 50 } |
| 52 | 51 |
| 53 void EasyUnlockUserLoginFlow::HandleOAuthTokenStatusChange( | 52 void EasyUnlockUserLoginFlow::HandleOAuthTokenStatusChange( |
| 54 user_manager::User::OAuthTokenStatus status) { | 53 user_manager::User::OAuthTokenStatus status) { |
| 55 } | 54 } |
| 56 | 55 |
| 57 void EasyUnlockUserLoginFlow::LaunchExtraSteps(Profile* profile) { | 56 void EasyUnlockUserLoginFlow::LaunchExtraSteps(Profile* profile) { |
| 58 } | 57 } |
| 59 | 58 |
| 60 bool EasyUnlockUserLoginFlow::SupportsEarlyRestartToApplyFlags() { | 59 bool EasyUnlockUserLoginFlow::SupportsEarlyRestartToApplyFlags() { |
| 61 return true; | 60 return true; |
| 62 } | 61 } |
| OLD | NEW |