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_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ |
6 #define COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ | 6 #define COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 // Called when the findEligibleUnlockDevices request succeeds. | 93 // Called when the findEligibleUnlockDevices request succeeds. |
94 void OnFoundEligibleUnlockDevices( | 94 void OnFoundEligibleUnlockDevices( |
95 const cryptauth::FindEligibleUnlockDevicesResponse& response); | 95 const cryptauth::FindEligibleUnlockDevicesResponse& response); |
96 | 96 |
97 // Callback when |reachable_phone_flow_| completes. | 97 // Callback when |reachable_phone_flow_| completes. |
98 void OnReachablePhonesFound( | 98 void OnReachablePhonesFound( |
99 const std::vector<cryptauth::ExternalDeviceInfo>& reachable_phones); | 99 const std::vector<cryptauth::ExternalDeviceInfo>& reachable_phones); |
100 | 100 |
101 // Called when the RemoteDevice is loaded so we can create a connection. | 101 // Called when the RemoteDevice is loaded so we can create a connection. |
102 void OnRemoteDevicesLoaded(const std::vector<RemoteDevice>& remote_devices); | 102 void OnRemoteDevicesLoaded( |
| 103 const std::vector<cryptauth::RemoteDevice>& remote_devices); |
103 | 104 |
104 // Converts an ExternalDeviceInfo proto to a JSON dictionary used in | 105 // Converts an ExternalDeviceInfo proto to a JSON dictionary used in |
105 // JavaScript. | 106 // JavaScript. |
106 std::unique_ptr<base::DictionaryValue> ExternalDeviceInfoToDictionary( | 107 std::unique_ptr<base::DictionaryValue> ExternalDeviceInfoToDictionary( |
107 const cryptauth::ExternalDeviceInfo& device_info); | 108 const cryptauth::ExternalDeviceInfo& device_info); |
108 | 109 |
109 // Converts an IneligibleDevice proto to a JSON dictionary used in JavaScript. | 110 // Converts an IneligibleDevice proto to a JSON dictionary used in JavaScript. |
110 std::unique_ptr<base::DictionaryValue> IneligibleDeviceToDictionary( | 111 std::unique_ptr<base::DictionaryValue> IneligibleDeviceToDictionary( |
111 const cryptauth::IneligibleDevice& ineligible_device); | 112 const cryptauth::IneligibleDevice& ineligible_device); |
112 | 113 |
(...skipping 28 matching lines...) Expand all Loading... |
141 // The flow for getting a list of reachable phones. | 142 // The flow for getting a list of reachable phones. |
142 std::unique_ptr<ReachablePhoneFlow> reachable_phone_flow_; | 143 std::unique_ptr<ReachablePhoneFlow> reachable_phone_flow_; |
143 | 144 |
144 // True if we get a message from the loaded WebContents to know that it is | 145 // True if we get a message from the loaded WebContents to know that it is |
145 // initialized, and we can inject JavaScript. | 146 // initialized, and we can inject JavaScript. |
146 bool web_contents_initialized_; | 147 bool web_contents_initialized_; |
147 | 148 |
148 // Member variables for connecting to and authenticating the remote device. | 149 // Member variables for connecting to and authenticating the remote device. |
149 // TODO(tengs): Support multiple simultaenous connections. | 150 // TODO(tengs): Support multiple simultaenous connections. |
150 std::unique_ptr<RemoteDeviceLoader> remote_device_loader_; | 151 std::unique_ptr<RemoteDeviceLoader> remote_device_loader_; |
151 RemoteDevice selected_remote_device_; | 152 cryptauth::RemoteDevice selected_remote_device_; |
152 std::unique_ptr<RemoteDeviceLifeCycle> life_cycle_; | 153 std::unique_ptr<RemoteDeviceLifeCycle> life_cycle_; |
153 std::unique_ptr<RemoteStatusUpdate> last_remote_status_update_; | 154 std::unique_ptr<RemoteStatusUpdate> last_remote_status_update_; |
154 | 155 |
155 base::WeakPtrFactory<ProximityAuthWebUIHandler> weak_ptr_factory_; | 156 base::WeakPtrFactory<ProximityAuthWebUIHandler> weak_ptr_factory_; |
156 | 157 |
157 DISALLOW_COPY_AND_ASSIGN(ProximityAuthWebUIHandler); | 158 DISALLOW_COPY_AND_ASSIGN(ProximityAuthWebUIHandler); |
158 }; | 159 }; |
159 | 160 |
160 } // namespace proximity_auth | 161 } // namespace proximity_auth |
161 | 162 |
162 #endif // COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ | 163 #endif // COMPONENTS_PROXIMITY_AUTH_WEBUI_PROXIMITY_AUTH_WEBUI_HANDLER_H_ |
OLD | NEW |