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/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 void UnlockManager::OnScreenDidLock( | 227 void UnlockManager::OnScreenDidLock( |
228 ScreenlockBridge::LockHandler::ScreenType screen_type) { | 228 ScreenlockBridge::LockHandler::ScreenType screen_type) { |
229 OnScreenLockedOrUnlocked(true); | 229 OnScreenLockedOrUnlocked(true); |
230 } | 230 } |
231 | 231 |
232 void UnlockManager::OnScreenDidUnlock( | 232 void UnlockManager::OnScreenDidUnlock( |
233 ScreenlockBridge::LockHandler::ScreenType screen_type) { | 233 ScreenlockBridge::LockHandler::ScreenType screen_type) { |
234 OnScreenLockedOrUnlocked(false); | 234 OnScreenLockedOrUnlocked(false); |
235 } | 235 } |
236 | 236 |
237 void UnlockManager::OnFocusedUserChanged(const std::string& user_id) {} | 237 void UnlockManager::OnFocusedUserChanged(const AccountId& account_id) {} |
238 | 238 |
239 void UnlockManager::OnScreenLockedOrUnlocked(bool is_locked) { | 239 void UnlockManager::OnScreenLockedOrUnlocked(bool is_locked) { |
240 // TODO(tengs): Chrome will only start connecting to the phone when | 240 // TODO(tengs): Chrome will only start connecting to the phone when |
241 // the screen is locked, for privacy reasons. We should reinvestigate | 241 // the screen is locked, for privacy reasons. We should reinvestigate |
242 // this behaviour if we want automatic locking. | 242 // this behaviour if we want automatic locking. |
243 if (is_locked && bluetooth_adapter_ && bluetooth_adapter_->IsPowered() && | 243 if (is_locked && bluetooth_adapter_ && bluetooth_adapter_->IsPowered() && |
244 life_cycle_ && | 244 life_cycle_ && |
245 life_cycle_->GetState() == | 245 life_cycle_->GetState() == |
246 RemoteDeviceLifeCycle::State::FINDING_CONNECTION) { | 246 RemoteDeviceLifeCycle::State::FINDING_CONNECTION) { |
247 SetWakingUpState(true); | 247 SetWakingUpState(true); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 | 492 |
493 Messenger* UnlockManager::GetMessenger() { | 493 Messenger* UnlockManager::GetMessenger() { |
494 // TODO(tengs): We should use a weak pointer to hold the Messenger instance | 494 // TODO(tengs): We should use a weak pointer to hold the Messenger instance |
495 // instead. | 495 // instead. |
496 if (!life_cycle_) | 496 if (!life_cycle_) |
497 return nullptr; | 497 return nullptr; |
498 return life_cycle_->GetMessenger(); | 498 return life_cycle_->GetMessenger(); |
499 } | 499 } |
500 | 500 |
501 } // namespace proximity_auth | 501 } // namespace proximity_auth |
OLD | NEW |