ExtensionSyncService: listen for relevant changes instead of being explicitly called...
[chromium-blink-merge.git] / chrome / browser / chromeos / login / easy_unlock / easy_unlock_user_login_flow.cc
blob6dec53e6b718fa58422b6176c277c548d7711652
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
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_user_login_flow.h"
7 #include "chrome/browser/chromeos/profiles/profile_helper.h"
8 #include "chrome/browser/signin/easy_unlock_service.h"
10 EasyUnlockUserLoginFlow::EasyUnlockUserLoginFlow(const std::string& user_id)
11 : chromeos::ExtendedUserFlow(user_id) {
14 EasyUnlockUserLoginFlow::~EasyUnlockUserLoginFlow() {}
16 bool EasyUnlockUserLoginFlow::CanLockScreen() {
17 return true;
20 bool EasyUnlockUserLoginFlow::ShouldLaunchBrowser() {
21 return true;
24 bool EasyUnlockUserLoginFlow::ShouldSkipPostLoginScreens() {
25 return false;
28 bool EasyUnlockUserLoginFlow::HandleLoginFailure(
29 const chromeos::AuthFailure& failure) {
30 Profile* profile = chromeos::ProfileHelper::GetSigninProfile();
31 EasyUnlockService* service = EasyUnlockService::Get(profile);
32 if (!service)
33 return false;
34 service->HandleAuthFailure(user_id());
35 service->RecordEasySignInOutcome(user_id(), false);
36 UnregisterFlowSoon();
37 return true;
40 void EasyUnlockUserLoginFlow::HandleLoginSuccess(
41 const chromeos::UserContext& context) {
42 Profile* profile = chromeos::ProfileHelper::GetSigninProfile();
43 EasyUnlockService* service = EasyUnlockService::Get(profile);
44 if (!service)
45 return;
46 service->RecordEasySignInOutcome(user_id(), true);
49 bool EasyUnlockUserLoginFlow::HandlePasswordChangeDetected() {
50 return false;
53 void EasyUnlockUserLoginFlow::HandleOAuthTokenStatusChange(
54 user_manager::User::OAuthTokenStatus status) {
57 void EasyUnlockUserLoginFlow::LaunchExtraSteps(Profile* profile) {
60 bool EasyUnlockUserLoginFlow::SupportsEarlyRestartToApplyFlags() {
61 return true;