| 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/remote_device_loader.h" | 5 #include "components/proximity_auth/remote_device_loader.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/base64url.h" | 10 #include "base/base64url.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "components/proximity_auth/cryptauth/secure_message_delegate.h" | 12 #include "components/proximity_auth/cryptauth/secure_message_delegate.h" |
| 13 #include "components/proximity_auth/logging/logging.h" | 13 #include "components/proximity_auth/logging/logging.h" |
| 14 #include "components/proximity_auth/proximity_auth_pref_manager.h" | 14 #include "components/proximity_auth/proximity_auth_pref_manager.h" |
| 15 | 15 |
| 16 namespace proximity_auth { | 16 namespace proximity_auth { |
| 17 | 17 |
| 18 RemoteDeviceLoader::RemoteDeviceLoader( | 18 RemoteDeviceLoader::RemoteDeviceLoader( |
| 19 const std::vector<cryptauth::ExternalDeviceInfo>& unlock_keys, | 19 const std::vector<cryptauth::ExternalDeviceInfo>& unlock_keys, |
| 20 const std::string& user_id, | 20 const std::string& user_id, |
| 21 const std::string& user_private_key, | 21 const std::string& user_private_key, |
| 22 scoped_ptr<SecureMessageDelegate> secure_message_delegate, | 22 std::unique_ptr<SecureMessageDelegate> secure_message_delegate, |
| 23 ProximityAuthPrefManager* pref_manager) | 23 ProximityAuthPrefManager* pref_manager) |
| 24 : remaining_unlock_keys_(unlock_keys), | 24 : remaining_unlock_keys_(unlock_keys), |
| 25 user_id_(user_id), | 25 user_id_(user_id), |
| 26 user_private_key_(user_private_key), | 26 user_private_key_(user_private_key), |
| 27 secure_message_delegate_(std::move(secure_message_delegate)), | 27 secure_message_delegate_(std::move(secure_message_delegate)), |
| 28 pref_manager_(pref_manager), | 28 pref_manager_(pref_manager), |
| 29 weak_ptr_factory_(this) {} | 29 weak_ptr_factory_(this) {} |
| 30 | 30 |
| 31 RemoteDeviceLoader::~RemoteDeviceLoader() {} | 31 RemoteDeviceLoader::~RemoteDeviceLoader() {} |
| 32 | 32 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 remote_devices_.push_back(RemoteDevice( | 87 remote_devices_.push_back(RemoteDevice( |
| 88 user_id_, unlock_key.friendly_device_name(), unlock_key.public_key(), | 88 user_id_, unlock_key.friendly_device_name(), unlock_key.public_key(), |
| 89 bluetooth_type, bluetooth_address, psk, std::string())); | 89 bluetooth_type, bluetooth_address, psk, std::string())); |
| 90 | 90 |
| 91 if (!remaining_unlock_keys_.size()) | 91 if (!remaining_unlock_keys_.size()) |
| 92 callback_.Run(remote_devices_); | 92 callback_.Run(remote_devices_); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace proximity_auth | 95 } // namespace proximity_auth |
| OLD | NEW |