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 "components/proximity_auth/proximity_auth_system.h" | 5 #include "components/proximity_auth/proximity_auth_system.h" |
6 | 6 |
7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "base/time/default_tick_clock.h" | 8 #include "base/time/default_tick_clock.h" |
9 #include "components/proximity_auth/logging/logging.h" | 9 #include "components/proximity_auth/logging/logging.h" |
10 #include "components/proximity_auth/proximity_auth_client.h" | 10 #include "components/proximity_auth/proximity_auth_client.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 void ProximityAuthSystem::OnAuthAttempted(const std::string& user_id) { | 50 void ProximityAuthSystem::OnAuthAttempted(const std::string& user_id) { |
51 // TODO(tengs): There is no reason to pass the |user_id| argument anymore. | 51 // TODO(tengs): There is no reason to pass the |user_id| argument anymore. |
52 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); | 52 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); |
53 } | 53 } |
54 | 54 |
55 void ProximityAuthSystem::OnSuspend() { | 55 void ProximityAuthSystem::OnSuspend() { |
56 PA_LOG(INFO) << "Preparing for device suspension."; | 56 PA_LOG(INFO) << "Preparing for device suspension."; |
57 DCHECK(!suspended_); | 57 DCHECK(!suspended_); |
58 suspended_ = true; | 58 suspended_ = true; |
| 59 unlock_manager_->SetRemoteDeviceLifeCycle(nullptr); |
59 remote_device_life_cycle_.reset(); | 60 remote_device_life_cycle_.reset(); |
60 } | 61 } |
61 | 62 |
62 void ProximityAuthSystem::OnSuspendDone() { | 63 void ProximityAuthSystem::OnSuspendDone() { |
63 PA_LOG(INFO) << "Device resumed from suspension."; | 64 PA_LOG(INFO) << "Device resumed from suspension."; |
64 DCHECK(suspended_); | 65 DCHECK(suspended_); |
65 | 66 |
66 // TODO(tengs): On ChromeOS, the system's Bluetooth adapter is invalidated | 67 // TODO(tengs): On ChromeOS, the system's Bluetooth adapter is invalidated |
67 // when the system suspends. However, Chrome does not receive this | 68 // when the system suspends. However, Chrome does not receive this |
68 // notification until a second or so after the system wakes up. That means | 69 // notification until a second or so after the system wakes up. That means |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 PA_LOG(INFO) << "Creating RemoteDeviceLifeCycle for focused user."; | 109 PA_LOG(INFO) << "Creating RemoteDeviceLifeCycle for focused user."; |
109 remote_device_life_cycle_.reset( | 110 remote_device_life_cycle_.reset( |
110 new RemoteDeviceLifeCycleImpl(remote_device_, proximity_auth_client_)); | 111 new RemoteDeviceLifeCycleImpl(remote_device_, proximity_auth_client_)); |
111 unlock_manager_->SetRemoteDeviceLifeCycle(remote_device_life_cycle_.get()); | 112 unlock_manager_->SetRemoteDeviceLifeCycle(remote_device_life_cycle_.get()); |
112 remote_device_life_cycle_->AddObserver(this); | 113 remote_device_life_cycle_->AddObserver(this); |
113 remote_device_life_cycle_->Start(); | 114 remote_device_life_cycle_->Start(); |
114 } | 115 } |
115 } | 116 } |
116 | 117 |
117 } // proximity_auth | 118 } // proximity_auth |
OLD | NEW |