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 */, | |
359 base::Bind(&ProximityAuthWebUIHandler::OnRemoteDevicesLoaded, | 358 base::Bind(&ProximityAuthWebUIHandler::OnRemoteDevicesLoaded, |
360 weak_ptr_factory_.GetWeakPtr())); | 359 weak_ptr_factory_.GetWeakPtr())); |
361 return; | 360 return; |
362 } | 361 } |
363 } | 362 } |
364 | 363 |
365 PA_LOG(ERROR) << "Unlock key (" << b64_public_key << ") not found"; | 364 PA_LOG(ERROR) << "Unlock key (" << b64_public_key << ") not found"; |
366 } | 365 } |
367 | 366 |
368 void ProximityAuthWebUIHandler::OnCryptAuthClientError( | 367 void ProximityAuthWebUIHandler::OnCryptAuthClientError( |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 << "\n trust_agent_state: " | 609 << "\n trust_agent_state: " |
611 << static_cast<int>(status_update.trust_agent_state); | 610 << static_cast<int>(status_update.trust_agent_state); |
612 | 611 |
613 last_remote_status_update_.reset(new RemoteStatusUpdate(status_update)); | 612 last_remote_status_update_.reset(new RemoteStatusUpdate(status_update)); |
614 std::unique_ptr<base::ListValue> unlock_keys = GetUnlockKeysList(); | 613 std::unique_ptr<base::ListValue> unlock_keys = GetUnlockKeysList(); |
615 web_ui()->CallJavascriptFunctionUnsafe( | 614 web_ui()->CallJavascriptFunctionUnsafe( |
616 "LocalStateInterface.onUnlockKeysChanged", *unlock_keys); | 615 "LocalStateInterface.onUnlockKeysChanged", *unlock_keys); |
617 } | 616 } |
618 | 617 |
619 } // namespace proximity_auth | 618 } // namespace proximity_auth |
OLD | NEW |