| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 dict->SetString("name", device.name); | 141 dict->SetString("name", device.name); |
| 142 dict->SetString("psk", b64_psk); | 142 dict->SetString("psk", b64_psk); |
| 143 dict->SetString("bluetoothAddress", device.bluetooth_address); | 143 dict->SetString("bluetoothAddress", device.bluetooth_address); |
| 144 dict->SetString("permitId", "permit://google.com/easyunlock/v1/" + | 144 dict->SetString("permitId", "permit://google.com/easyunlock/v1/" + |
| 145 proximity_auth_client()->GetAccountId()); | 145 proximity_auth_client()->GetAccountId()); |
| 146 dict->SetString("permitRecord.id", b64_public_key); | 146 dict->SetString("permitRecord.id", b64_public_key); |
| 147 dict->SetString("permitRecord.type", "license"); | 147 dict->SetString("permitRecord.type", "license"); |
| 148 dict->SetString("permitRecord.data", b64_public_key); | 148 dict->SetString("permitRecord.data", b64_public_key); |
| 149 | 149 |
| 150 // TODO(tengs): Retrieve the actual BeaconSeeds from the RemoteDevice. | |
| 151 std::vector<cryptauth::BeaconSeed> beacon_seeds; | |
| 152 std::unique_ptr<base::ListValue> beacon_seed_list(new base::ListValue()); | 150 std::unique_ptr<base::ListValue> beacon_seed_list(new base::ListValue()); |
| 153 for (const auto& beacon_seed : beacon_seeds) { | 151 for (const auto& beacon_seed : device.beacon_seeds) { |
| 154 std::string b64_beacon_seed; | 152 std::string b64_beacon_seed; |
| 155 base::Base64UrlEncode(beacon_seed.SerializeAsString(), | 153 base::Base64UrlEncode(beacon_seed.SerializeAsString(), |
| 156 base::Base64UrlEncodePolicy::INCLUDE_PADDING, | 154 base::Base64UrlEncodePolicy::INCLUDE_PADDING, |
| 157 &b64_beacon_seed); | 155 &b64_beacon_seed); |
| 158 beacon_seed_list->AppendString(b64_beacon_seed); | 156 beacon_seed_list->AppendString(b64_beacon_seed); |
| 159 } | 157 } |
| 160 | 158 |
| 161 std::string serialized_beacon_seeds; | 159 std::string serialized_beacon_seeds; |
| 162 JSONStringValueSerializer serializer(&serialized_beacon_seeds); | 160 JSONStringValueSerializer serializer(&serialized_beacon_seeds); |
| 163 serializer.Serialize(*beacon_seed_list); | 161 serializer.Serialize(*beacon_seed_list); |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 631 |
| 634 cryptauth::CryptAuthDeviceManager* | 632 cryptauth::CryptAuthDeviceManager* |
| 635 EasyUnlockServiceRegular::GetCryptAuthDeviceManager() { | 633 EasyUnlockServiceRegular::GetCryptAuthDeviceManager() { |
| 636 cryptauth::CryptAuthDeviceManager* manager = | 634 cryptauth::CryptAuthDeviceManager* manager = |
| 637 ChromeCryptAuthServiceFactory::GetInstance() | 635 ChromeCryptAuthServiceFactory::GetInstance() |
| 638 ->GetForBrowserContext(profile()) | 636 ->GetForBrowserContext(profile()) |
| 639 ->GetCryptAuthDeviceManager(); | 637 ->GetCryptAuthDeviceManager(); |
| 640 DCHECK(manager); | 638 DCHECK(manager); |
| 641 return manager; | 639 return manager; |
| 642 } | 640 } |
| OLD | NEW |