| 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/webui/proximity_auth_webui_handler.h" | 5 #include "components/proximity_auth/webui/proximity_auth_webui_handler.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" |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 } | 348 } |
| 349 | 349 |
| 350 // TODO(sacomoto): Pass an instance of ProximityAuthPrefManager. This is | 350 // TODO(sacomoto): Pass an instance of ProximityAuthPrefManager. This is |
| 351 // used to get the address of BLE devices. | 351 // used to get the address of BLE devices. |
| 352 remote_device_loader_.reset(new cryptauth::RemoteDeviceLoader( | 352 remote_device_loader_.reset(new cryptauth::RemoteDeviceLoader( |
| 353 std::vector<cryptauth::ExternalDeviceInfo>(1, unlock_key), | 353 std::vector<cryptauth::ExternalDeviceInfo>(1, unlock_key), |
| 354 proximity_auth_client_->GetAccountId(), | 354 proximity_auth_client_->GetAccountId(), |
| 355 enrollment_manager->GetUserPrivateKey(), | 355 enrollment_manager->GetUserPrivateKey(), |
| 356 proximity_auth_client_->CreateSecureMessageDelegate())); | 356 proximity_auth_client_->CreateSecureMessageDelegate())); |
| 357 remote_device_loader_->Load( | 357 remote_device_loader_->Load( |
| 358 true /* should_load_beacon_seeds */, |
| 358 base::Bind(&ProximityAuthWebUIHandler::OnRemoteDevicesLoaded, | 359 base::Bind(&ProximityAuthWebUIHandler::OnRemoteDevicesLoaded, |
| 359 weak_ptr_factory_.GetWeakPtr())); | 360 weak_ptr_factory_.GetWeakPtr())); |
| 360 return; | 361 return; |
| 361 } | 362 } |
| 362 } | 363 } |
| 363 | 364 |
| 364 PA_LOG(ERROR) << "Unlock key (" << b64_public_key << ") not found"; | 365 PA_LOG(ERROR) << "Unlock key (" << b64_public_key << ") not found"; |
| 365 } | 366 } |
| 366 | 367 |
| 367 void ProximityAuthWebUIHandler::OnCryptAuthClientError( | 368 void ProximityAuthWebUIHandler::OnCryptAuthClientError( |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 << "\n trust_agent_state: " | 610 << "\n trust_agent_state: " |
| 610 << static_cast<int>(status_update.trust_agent_state); | 611 << static_cast<int>(status_update.trust_agent_state); |
| 611 | 612 |
| 612 last_remote_status_update_.reset(new RemoteStatusUpdate(status_update)); | 613 last_remote_status_update_.reset(new RemoteStatusUpdate(status_update)); |
| 613 std::unique_ptr<base::ListValue> unlock_keys = GetUnlockKeysList(); | 614 std::unique_ptr<base::ListValue> unlock_keys = GetUnlockKeysList(); |
| 614 web_ui()->CallJavascriptFunctionUnsafe( | 615 web_ui()->CallJavascriptFunctionUnsafe( |
| 615 "LocalStateInterface.onUnlockKeysChanged", *unlock_keys); | 616 "LocalStateInterface.onUnlockKeysChanged", *unlock_keys); |
| 616 } | 617 } |
| 617 | 618 |
| 618 } // namespace proximity_auth | 619 } // namespace proximity_auth |
| OLD | NEW |