| 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_impl.h" | 5 #include "components/proximity_auth/unlock_manager_impl.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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 weak_ptr_factory_(this) { | 95 weak_ptr_factory_(this) { |
| 96 ScreenlockBridge* screenlock_bridge = ScreenlockBridge::Get(); | 96 ScreenlockBridge* screenlock_bridge = ScreenlockBridge::Get(); |
| 97 screenlock_bridge->AddObserver(this); | 97 screenlock_bridge->AddObserver(this); |
| 98 OnScreenLockedOrUnlocked(screenlock_bridge->IsLocked()); | 98 OnScreenLockedOrUnlocked(screenlock_bridge->IsLocked()); |
| 99 | 99 |
| 100 #if defined(OS_CHROMEOS) | 100 #if defined(OS_CHROMEOS) |
| 101 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); | 101 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); |
| 102 #endif // defined(OS_CHROMEOS) | 102 #endif // defined(OS_CHROMEOS) |
| 103 SetWakingUpState(true); | 103 SetWakingUpState(true); |
| 104 | 104 |
| 105 if (device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable()) { | 105 if (device::BluetoothAdapterFactory::IsBluetoothSupported()) { |
| 106 device::BluetoothAdapterFactory::GetAdapter( | 106 device::BluetoothAdapterFactory::GetAdapter( |
| 107 base::Bind(&UnlockManagerImpl::OnBluetoothAdapterInitialized, | 107 base::Bind(&UnlockManagerImpl::OnBluetoothAdapterInitialized, |
| 108 weak_ptr_factory_.GetWeakPtr())); | 108 weak_ptr_factory_.GetWeakPtr())); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 UnlockManagerImpl::~UnlockManagerImpl() { | 112 UnlockManagerImpl::~UnlockManagerImpl() { |
| 113 if (GetMessenger()) | 113 if (GetMessenger()) |
| 114 GetMessenger()->RemoveObserver(this); | 114 GetMessenger()->RemoveObserver(this); |
| 115 | 115 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 495 |
| 496 Messenger* UnlockManagerImpl::GetMessenger() { | 496 Messenger* UnlockManagerImpl::GetMessenger() { |
| 497 // TODO(tengs): We should use a weak pointer to hold the Messenger instance | 497 // TODO(tengs): We should use a weak pointer to hold the Messenger instance |
| 498 // instead. | 498 // instead. |
| 499 if (!life_cycle_) | 499 if (!life_cycle_) |
| 500 return nullptr; | 500 return nullptr; |
| 501 return life_cycle_->GetMessenger(); | 501 return life_cycle_->GetMessenger(); |
| 502 } | 502 } |
| 503 | 503 |
| 504 } // namespace proximity_auth | 504 } // namespace proximity_auth |
| OLD | NEW |