Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: components/proximity_auth/unlock_manager.cc

Issue 1494153002: This CL replaces e-mail with AccountId in easy signin code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bugfix in original easy unlock code' Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/proximity_auth/unlock_manager.h ('k') | components/proximity_auth/unlock_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698