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