| 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 #ifndef COMPONENTS_PROXIMITY_AUTH_UNLOCK_MANAGER_IMPL_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_UNLOCK_MANAGER_IMPL_H |
| 6 #define COMPONENTS_PROXIMITY_AUTH_UNLOCK_MANAGER_IMPL_H | 6 #define COMPONENTS_PROXIMITY_AUTH_UNLOCK_MANAGER_IMPL_H |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "components/proximity_auth/messenger_observer.h" | 12 #include "components/proximity_auth/messenger_observer.h" |
| 13 #include "components/proximity_auth/proximity_auth_system.h" | 13 #include "components/proximity_auth/proximity_auth_system.h" |
| 14 #include "components/proximity_auth/proximity_monitor_observer.h" | 14 #include "components/proximity_auth/proximity_monitor_observer.h" |
| 15 #include "components/proximity_auth/remote_device_life_cycle.h" | 15 #include "components/proximity_auth/remote_device_life_cycle.h" |
| 16 #include "components/proximity_auth/remote_status_update.h" | 16 #include "components/proximity_auth/remote_status_update.h" |
| 17 #include "components/proximity_auth/screenlock_bridge.h" | 17 #include "components/proximity_auth/screenlock_bridge.h" |
| 18 #include "components/proximity_auth/screenlock_state.h" | 18 #include "components/proximity_auth/screenlock_state.h" |
| 19 #include "components/proximity_auth/unlock_manager.h" | 19 #include "components/proximity_auth/unlock_manager.h" |
| 20 #include "device/bluetooth/bluetooth_adapter.h" | 20 #include "device/bluetooth/bluetooth_adapter.h" |
| 21 | 21 |
| 22 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
| 23 #include "chromeos/dbus/power_manager_client.h" | 23 #include "chromeos/dbus/power_manager_client.h" |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 class PrefService; |
| 27 |
| 26 namespace proximity_auth { | 28 namespace proximity_auth { |
| 27 | 29 |
| 28 class Messenger; | 30 class Messenger; |
| 29 class ProximityAuthClient; | 31 class ProximityAuthClient; |
| 30 class ProximityMonitor; | 32 class ProximityMonitor; |
| 31 | 33 |
| 32 // The unlock manager is responsible for controlling the lock screen UI based on | 34 // The unlock manager is responsible for controlling the lock screen UI based on |
| 33 // the authentication status of the registered remote devices. | 35 // the authentication status of the registered remote devices. |
| 34 class UnlockManagerImpl : public UnlockManager, | 36 class UnlockManagerImpl : public UnlockManager, |
| 35 public MessengerObserver, | 37 public MessengerObserver, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 49 // UnlockManager: | 51 // UnlockManager: |
| 50 bool IsUnlockAllowed() override; | 52 bool IsUnlockAllowed() override; |
| 51 void SetRemoteDeviceLifeCycle(RemoteDeviceLifeCycle* life_cycle) override; | 53 void SetRemoteDeviceLifeCycle(RemoteDeviceLifeCycle* life_cycle) override; |
| 52 void OnLifeCycleStateChanged() override; | 54 void OnLifeCycleStateChanged() override; |
| 53 void OnAuthAttempted(mojom::AuthType auth_type) override; | 55 void OnAuthAttempted(mojom::AuthType auth_type) override; |
| 54 | 56 |
| 55 protected: | 57 protected: |
| 56 // Creates a ProximityMonitor instance for the given |connection|. | 58 // Creates a ProximityMonitor instance for the given |connection|. |
| 57 // Exposed for testing. | 59 // Exposed for testing. |
| 58 virtual std::unique_ptr<ProximityMonitor> CreateProximityMonitor( | 60 virtual std::unique_ptr<ProximityMonitor> CreateProximityMonitor( |
| 59 cryptauth::Connection* connection); | 61 cryptauth::Connection* connection, |
| 62 PrefService* pref_service); |
| 60 | 63 |
| 61 private: | 64 private: |
| 62 // The possible lock screen states for the remote device. | 65 // The possible lock screen states for the remote device. |
| 63 enum class RemoteScreenlockState { | 66 enum class RemoteScreenlockState { |
| 64 UNKNOWN, | 67 UNKNOWN, |
| 65 UNLOCKED, | 68 UNLOCKED, |
| 66 DISABLED, | 69 DISABLED, |
| 67 LOCKED, | 70 LOCKED, |
| 68 }; | 71 }; |
| 69 | 72 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 190 |
| 188 // Used to vend all other weak pointers. | 191 // Used to vend all other weak pointers. |
| 189 base::WeakPtrFactory<UnlockManagerImpl> weak_ptr_factory_; | 192 base::WeakPtrFactory<UnlockManagerImpl> weak_ptr_factory_; |
| 190 | 193 |
| 191 DISALLOW_COPY_AND_ASSIGN(UnlockManagerImpl); | 194 DISALLOW_COPY_AND_ASSIGN(UnlockManagerImpl); |
| 192 }; | 195 }; |
| 193 | 196 |
| 194 } // namespace proximity_auth | 197 } // namespace proximity_auth |
| 195 | 198 |
| 196 #endif // COMPONENTS_PROXIMITY_AUTH_UNLOCK_MANAGER_IMPL_H | 199 #endif // COMPONENTS_PROXIMITY_AUTH_UNLOCK_MANAGER_IMPL_H |
| OLD | NEW |