| 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.h" | 5 #include "components/proximity_auth/unlock_manager.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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } else { | 314 } else { |
| 315 PA_LOG(INFO) << "[Unlock] Protocol v3.1 not supported, skipping " | 315 PA_LOG(INFO) << "[Unlock] Protocol v3.1 not supported, skipping " |
| 316 << "request_unlock."; | 316 << "request_unlock."; |
| 317 GetMessenger()->DispatchUnlockEvent(); | 317 GetMessenger()->DispatchUnlockEvent(); |
| 318 } | 318 } |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 | 321 |
| 322 std::unique_ptr<ProximityMonitor> UnlockManager::CreateProximityMonitor( | 322 std::unique_ptr<ProximityMonitor> UnlockManager::CreateProximityMonitor( |
| 323 const RemoteDevice& remote_device) { | 323 const RemoteDevice& remote_device) { |
| 324 return base::WrapUnique(new ProximityMonitorImpl( | 324 return base::MakeUnique<ProximityMonitorImpl>( |
| 325 remote_device, base::WrapUnique(new base::DefaultTickClock()))); | 325 remote_device, base::WrapUnique(new base::DefaultTickClock())); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void UnlockManager::SendSignInChallenge() { | 328 void UnlockManager::SendSignInChallenge() { |
| 329 if (!life_cycle_ || !GetMessenger() || !GetMessenger()->GetSecureContext()) { | 329 if (!life_cycle_ || !GetMessenger() || !GetMessenger()->GetSecureContext()) { |
| 330 PA_LOG(ERROR) << "Not ready to send sign-in challenge"; | 330 PA_LOG(ERROR) << "Not ready to send sign-in challenge"; |
| 331 return; | 331 return; |
| 332 } | 332 } |
| 333 | 333 |
| 334 RemoteDevice remote_device = life_cycle_->GetRemoteDevice(); | 334 RemoteDevice remote_device = life_cycle_->GetRemoteDevice(); |
| 335 proximity_auth_client_->GetChallengeForUserAndDevice( | 335 proximity_auth_client_->GetChallengeForUserAndDevice( |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 494 |
| 495 Messenger* UnlockManager::GetMessenger() { | 495 Messenger* UnlockManager::GetMessenger() { |
| 496 // TODO(tengs): We should use a weak pointer to hold the Messenger instance | 496 // TODO(tengs): We should use a weak pointer to hold the Messenger instance |
| 497 // instead. | 497 // instead. |
| 498 if (!life_cycle_) | 498 if (!life_cycle_) |
| 499 return nullptr; | 499 return nullptr; |
| 500 return life_cycle_->GetMessenger(); | 500 return life_cycle_->GetMessenger(); |
| 501 } | 501 } |
| 502 | 502 |
| 503 } // namespace proximity_auth | 503 } // namespace proximity_auth |
| OLD | NEW |