| 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/extensions/api/easy_unlock_private/easy_unlock_private_
api.h" | 5 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_
api.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64url.h" | 10 #include "base/base64url.h" |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 return enrollment_manager->GetUserPrivateKey(); | 723 return enrollment_manager->GetUserPrivateKey(); |
| 724 } | 724 } |
| 725 | 725 |
| 726 std::vector<cryptauth::ExternalDeviceInfo> | 726 std::vector<cryptauth::ExternalDeviceInfo> |
| 727 EasyUnlockPrivateGetRemoteDevicesFunction::GetUnlockKeys() { | 727 EasyUnlockPrivateGetRemoteDevicesFunction::GetUnlockKeys() { |
| 728 Profile* profile = Profile::FromBrowserContext(browser_context()); | 728 Profile* profile = Profile::FromBrowserContext(browser_context()); |
| 729 proximity_auth::ProximityAuthClient* client = | 729 proximity_auth::ProximityAuthClient* client = |
| 730 EasyUnlockService::Get(profile)->proximity_auth_client(); | 730 EasyUnlockService::Get(profile)->proximity_auth_client(); |
| 731 cryptauth::CryptAuthDeviceManager* device_manager = | 731 cryptauth::CryptAuthDeviceManager* device_manager = |
| 732 client->GetCryptAuthDeviceManager(); | 732 client->GetCryptAuthDeviceManager(); |
| 733 return device_manager->unlock_keys(); | 733 return device_manager->UnlockKeys(); |
| 734 } | 734 } |
| 735 | 735 |
| 736 void EasyUnlockPrivateGetRemoteDevicesFunction::ReturnDevicesForExperiment() { | 736 void EasyUnlockPrivateGetRemoteDevicesFunction::ReturnDevicesForExperiment() { |
| 737 // Check that we are inside a user profile. | 737 // Check that we are inside a user profile. |
| 738 Profile* profile = Profile::FromBrowserContext(browser_context()); | 738 Profile* profile = Profile::FromBrowserContext(browser_context()); |
| 739 EasyUnlockService* easy_unlock_service = EasyUnlockService::Get(profile); | 739 EasyUnlockService* easy_unlock_service = EasyUnlockService::Get(profile); |
| 740 if (easy_unlock_service->GetType() != EasyUnlockService::TYPE_REGULAR) { | 740 if (easy_unlock_service->GetType() != EasyUnlockService::TYPE_REGULAR) { |
| 741 SetError("This function must be called inside a user session."); | 741 SetError("This function must be called inside a user session."); |
| 742 SendResponse(true); | 742 SendResponse(true); |
| 743 return; | 743 return; |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 GetConnectionManager(browser_context()) | 1181 GetConnectionManager(browser_context()) |
| 1182 ->GetDeviceAddress(extension(), params->connection_id); | 1182 ->GetDeviceAddress(extension(), params->connection_id); |
| 1183 if (device_address.empty()) | 1183 if (device_address.empty()) |
| 1184 return RespondNow(Error("Invalid connectionId.")); | 1184 return RespondNow(Error("Invalid connectionId.")); |
| 1185 return RespondNow(ArgumentList( | 1185 return RespondNow(ArgumentList( |
| 1186 easy_unlock_private::SetupConnectionGetDeviceAddress::Results::Create( | 1186 easy_unlock_private::SetupConnectionGetDeviceAddress::Results::Create( |
| 1187 device_address))); | 1187 device_address))); |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 } // namespace extensions | 1190 } // namespace extensions |
| OLD | NEW |