| 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 "components/proximity_auth/unlock_manager_impl.h" | 5 #include "components/proximity_auth/unlock_manager_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 bool powered) { | 276 bool powered) { |
| 277 UpdateLockScreen(); | 277 UpdateLockScreen(); |
| 278 } | 278 } |
| 279 | 279 |
| 280 #if defined(OS_CHROMEOS) | 280 #if defined(OS_CHROMEOS) |
| 281 void UnlockManagerImpl::SuspendDone(const base::TimeDelta& sleep_duration) { | 281 void UnlockManagerImpl::SuspendDone(const base::TimeDelta& sleep_duration) { |
| 282 SetWakingUpState(true); | 282 SetWakingUpState(true); |
| 283 } | 283 } |
| 284 #endif // defined(OS_CHROMEOS) | 284 #endif // defined(OS_CHROMEOS) |
| 285 | 285 |
| 286 void UnlockManagerImpl::OnAuthAttempted( | 286 void UnlockManagerImpl::OnAuthAttempted(mojom::AuthType auth_type) { |
| 287 ScreenlockBridge::LockHandler::AuthType auth_type) { | |
| 288 if (is_attempting_auth_) { | 287 if (is_attempting_auth_) { |
| 289 PA_LOG(INFO) << "Already attempting auth."; | 288 PA_LOG(INFO) << "Already attempting auth."; |
| 290 return; | 289 return; |
| 291 } | 290 } |
| 292 | 291 |
| 293 if (auth_type != ScreenlockBridge::LockHandler::USER_CLICK) | 292 if (auth_type != mojom::AuthType::USER_CLICK) |
| 294 return; | 293 return; |
| 295 | 294 |
| 296 is_attempting_auth_ = true; | 295 is_attempting_auth_ = true; |
| 297 | 296 |
| 298 if (!life_cycle_) { | 297 if (!life_cycle_) { |
| 299 PA_LOG(ERROR) << "No life_cycle active when auth is attempted"; | 298 PA_LOG(ERROR) << "No life_cycle active when auth is attempted"; |
| 300 AcceptAuthAttempt(false); | 299 AcceptAuthAttempt(false); |
| 301 UpdateLockScreen(); | 300 UpdateLockScreen(); |
| 302 return; | 301 return; |
| 303 } | 302 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 | 496 |
| 498 Messenger* UnlockManagerImpl::GetMessenger() { | 497 Messenger* UnlockManagerImpl::GetMessenger() { |
| 499 // TODO(tengs): We should use a weak pointer to hold the Messenger instance | 498 // TODO(tengs): We should use a weak pointer to hold the Messenger instance |
| 500 // instead. | 499 // instead. |
| 501 if (!life_cycle_) | 500 if (!life_cycle_) |
| 502 return nullptr; | 501 return nullptr; |
| 503 return life_cycle_->GetMessenger(); | 502 return life_cycle_->GetMessenger(); |
| 504 } | 503 } |
| 505 | 504 |
| 506 } // namespace proximity_auth | 505 } // namespace proximity_auth |
| OLD | NEW |