| 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/signin/easy_unlock_auth_attempt.h" | 5 #include "chrome/browser/signin/easy_unlock_auth_attempt.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (state_ == STATE_RUNNING) | 101 if (state_ == STATE_RUNNING) |
| 102 Cancel(account_id_); | 102 Cancel(account_id_); |
| 103 } | 103 } |
| 104 | 104 |
| 105 bool EasyUnlockAuthAttempt::Start() { | 105 bool EasyUnlockAuthAttempt::Start() { |
| 106 DCHECK_EQ(STATE_IDLE, state_); | 106 DCHECK_EQ(STATE_IDLE, state_); |
| 107 | 107 |
| 108 if (!proximity_auth::ScreenlockBridge::Get()->IsLocked()) | 108 if (!proximity_auth::ScreenlockBridge::Get()->IsLocked()) |
| 109 return false; | 109 return false; |
| 110 | 110 |
| 111 proximity_auth::ScreenlockBridge::LockHandler::AuthType auth_type = | 111 proximity_auth::mojom::AuthType auth_type = |
| 112 proximity_auth::ScreenlockBridge::Get()->lock_handler()->GetAuthType( | 112 proximity_auth::ScreenlockBridge::Get()->lock_handler()->GetAuthType( |
| 113 account_id_); | 113 account_id_); |
| 114 | 114 |
| 115 if (auth_type != proximity_auth::ScreenlockBridge::LockHandler::USER_CLICK) { | 115 if (auth_type != proximity_auth::mojom::AuthType::USER_CLICK) { |
| 116 Cancel(account_id_); | 116 Cancel(account_id_); |
| 117 return false; | 117 return false; |
| 118 } | 118 } |
| 119 | 119 |
| 120 state_ = STATE_RUNNING; | 120 state_ = STATE_RUNNING; |
| 121 | 121 |
| 122 // We need this workaround for ProximityAuthSystem, since we don't load the | 122 // We need this workaround for ProximityAuthSystem, since we don't load the |
| 123 // full background app anymore. The call to | 123 // full background app anymore. The call to |
| 124 // |app_manager_->SendAuthAttemptEvent()| returns false, as there is no | 124 // |app_manager_->SendAuthAttemptEvent()| returns false, as there is no |
| 125 // observer registered for the |screenlock::OnAuthAttempted| event. As a | 125 // observer registered for the |screenlock::OnAuthAttempted| event. As a |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 state_ = STATE_DONE; | 186 state_ = STATE_DONE; |
| 187 } | 187 } |
| 188 | 188 |
| 189 void EasyUnlockAuthAttempt::Cancel(const AccountId& account_id) { | 189 void EasyUnlockAuthAttempt::Cancel(const AccountId& account_id) { |
| 190 state_ = STATE_DONE; | 190 state_ = STATE_DONE; |
| 191 | 191 |
| 192 const bool kFailure = false; | 192 const bool kFailure = false; |
| 193 finalized_callback_.Run(type_, kFailure, account_id, std::string(), | 193 finalized_callback_.Run(type_, kFailure, account_id, std::string(), |
| 194 std::string()); | 194 std::string()); |
| 195 } | 195 } |
| OLD | NEW |