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_REMOTE_DEVICE_LIFE_CYCLE_IMPL_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_REMOTE_DEVICE_LIFE_CYCLE_IMPL_H |
6 #define COMPONENTS_PROXIMITY_AUTH_REMOTE_DEVICE_LIFE_CYCLE_IMPL_H | 6 #define COMPONENTS_PROXIMITY_AUTH_REMOTE_DEVICE_LIFE_CYCLE_IMPL_H |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 public: | 34 public: |
35 // Creates the life cycle for controlling the given |remote_device|. | 35 // Creates the life cycle for controlling the given |remote_device|. |
36 // |proximity_auth_client| is not owned. | 36 // |proximity_auth_client| is not owned. |
37 RemoteDeviceLifeCycleImpl(const cryptauth::RemoteDevice& remote_device, | 37 RemoteDeviceLifeCycleImpl(const cryptauth::RemoteDevice& remote_device, |
38 ProximityAuthClient* proximity_auth_client); | 38 ProximityAuthClient* proximity_auth_client); |
39 ~RemoteDeviceLifeCycleImpl() override; | 39 ~RemoteDeviceLifeCycleImpl() override; |
40 | 40 |
41 // RemoteDeviceLifeCycle: | 41 // RemoteDeviceLifeCycle: |
42 void Start() override; | 42 void Start() override; |
43 cryptauth::RemoteDevice GetRemoteDevice() const override; | 43 cryptauth::RemoteDevice GetRemoteDevice() const override; |
| 44 cryptauth::Connection* GetConnection() const override; |
44 RemoteDeviceLifeCycle::State GetState() const override; | 45 RemoteDeviceLifeCycle::State GetState() const override; |
45 Messenger* GetMessenger() override; | 46 Messenger* GetMessenger() override; |
46 void AddObserver(Observer* observer) override; | 47 void AddObserver(Observer* observer) override; |
47 void RemoveObserver(Observer* observer) override; | 48 void RemoveObserver(Observer* observer) override; |
48 | 49 |
49 protected: | 50 protected: |
50 // Creates and returns a cryptauth::ConnectionFinder instance for | 51 // Creates and returns a cryptauth::ConnectionFinder instance for |
51 // |remote_device_|. | 52 // |remote_device_|. |
52 // Exposed for testing. | 53 // Exposed for testing. |
53 virtual std::unique_ptr<cryptauth::ConnectionFinder> CreateConnectionFinder(); | 54 virtual std::unique_ptr<cryptauth::ConnectionFinder> CreateConnectionFinder(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 base::OneShotTimer authentication_recovery_timer_; | 119 base::OneShotTimer authentication_recovery_timer_; |
119 | 120 |
120 base::WeakPtrFactory<RemoteDeviceLifeCycleImpl> weak_ptr_factory_; | 121 base::WeakPtrFactory<RemoteDeviceLifeCycleImpl> weak_ptr_factory_; |
121 | 122 |
122 DISALLOW_COPY_AND_ASSIGN(RemoteDeviceLifeCycleImpl); | 123 DISALLOW_COPY_AND_ASSIGN(RemoteDeviceLifeCycleImpl); |
123 }; | 124 }; |
124 | 125 |
125 } // namespace proximity_auth | 126 } // namespace proximity_auth |
126 | 127 |
127 #endif // COMPONENTS_PROXIMITY_AUTH_REMOTE_DEVICE_LIFE_CYCLE_IMPL_H | 128 #endif // COMPONENTS_PROXIMITY_AUTH_REMOTE_DEVICE_LIFE_CYCLE_IMPL_H |
OLD | NEW |