| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/signin/easy_unlock_service_regular.h" | 5 #include "chrome/browser/signin/easy_unlock_service_regular.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return device_manager_.get(); | 97 return device_manager_.get(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 proximity_auth::ProximityAuthPrefManager* | 100 proximity_auth::ProximityAuthPrefManager* |
| 101 EasyUnlockServiceRegular::GetProximityAuthPrefManager() { | 101 EasyUnlockServiceRegular::GetProximityAuthPrefManager() { |
| 102 return pref_manager_.get(); | 102 return pref_manager_.get(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void EasyUnlockServiceRegular::LoadRemoteDevices() { | 105 void EasyUnlockServiceRegular::LoadRemoteDevices() { |
| 106 if (device_manager_->unlock_keys().empty()) { | 106 if (device_manager_->unlock_keys().empty()) { |
| 107 SetProximityAuthDevices(GetAccountId(), proximity_auth::RemoteDeviceList()); | 107 SetProximityAuthDevices(GetAccountId(), cryptauth::RemoteDeviceList()); |
| 108 return; | 108 return; |
| 109 } | 109 } |
| 110 | 110 |
| 111 remote_device_loader_.reset(new proximity_auth::RemoteDeviceLoader( | 111 remote_device_loader_.reset(new proximity_auth::RemoteDeviceLoader( |
| 112 device_manager_->unlock_keys(), proximity_auth_client()->GetAccountId(), | 112 device_manager_->unlock_keys(), proximity_auth_client()->GetAccountId(), |
| 113 enrollment_manager_->GetUserPrivateKey(), | 113 enrollment_manager_->GetUserPrivateKey(), |
| 114 proximity_auth_client()->CreateSecureMessageDelegate(), | 114 proximity_auth_client()->CreateSecureMessageDelegate(), |
| 115 pref_manager_.get())); | 115 pref_manager_.get())); |
| 116 remote_device_loader_->Load( | 116 remote_device_loader_->Load( |
| 117 base::Bind(&EasyUnlockServiceRegular::OnRemoteDevicesLoaded, | 117 base::Bind(&EasyUnlockServiceRegular::OnRemoteDevicesLoaded, |
| 118 weak_ptr_factory_.GetWeakPtr())); | 118 weak_ptr_factory_.GetWeakPtr())); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void EasyUnlockServiceRegular::OnRemoteDevicesLoaded( | 121 void EasyUnlockServiceRegular::OnRemoteDevicesLoaded( |
| 122 const proximity_auth::RemoteDeviceList& remote_devices) { | 122 const cryptauth::RemoteDeviceList& remote_devices) { |
| 123 SetProximityAuthDevices(GetAccountId(), remote_devices); | 123 SetProximityAuthDevices(GetAccountId(), remote_devices); |
| 124 | 124 |
| 125 #if defined(OS_CHROMEOS) | 125 #if defined(OS_CHROMEOS) |
| 126 // We need to store a copy of |remote devices_| in the TPM, so it can be | 126 // We need to store a copy of |remote devices_| in the TPM, so it can be |
| 127 // retrieved on the sign-in screen when a user session has not been started | 127 // retrieved on the sign-in screen when a user session has not been started |
| 128 // yet. | 128 // yet. |
| 129 std::unique_ptr<base::ListValue> device_list(new base::ListValue()); | 129 std::unique_ptr<base::ListValue> device_list(new base::ListValue()); |
| 130 for (const auto& device : remote_devices) { | 130 for (const auto& device : remote_devices) { |
| 131 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 131 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 132 std::string b64_public_key, b64_psk; | 132 std::string b64_public_key, b64_psk; |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 PA_LOG(INFO) << "Refresh token not yet available, " | 680 PA_LOG(INFO) << "Refresh token not yet available, " |
| 681 << "waiting before starting CryptAuth managers"; | 681 << "waiting before starting CryptAuth managers"; |
| 682 token_service->AddObserver(this); | 682 token_service->AddObserver(this); |
| 683 } | 683 } |
| 684 | 684 |
| 685 device_manager_->AddObserver(this); | 685 device_manager_->AddObserver(this); |
| 686 enrollment_manager_->Start(); | 686 enrollment_manager_->Start(); |
| 687 device_manager_->Start(); | 687 device_manager_->Start(); |
| 688 } | 688 } |
| 689 #endif | 689 #endif |
| OLD | NEW |