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/chromeos/login/easy_unlock/easy_unlock_key_manager.h" | 5 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // static | 111 // static |
112 void EasyUnlockKeyManager::DeviceDataToRemoteDeviceDictionary( | 112 void EasyUnlockKeyManager::DeviceDataToRemoteDeviceDictionary( |
113 const AccountId& account_id, | 113 const AccountId& account_id, |
114 const EasyUnlockDeviceKeyData& data, | 114 const EasyUnlockDeviceKeyData& data, |
115 base::DictionaryValue* dict) { | 115 base::DictionaryValue* dict) { |
116 dict->SetString(kKeyBluetoothAddress, data.bluetooth_address); | 116 dict->SetString(kKeyBluetoothAddress, data.bluetooth_address); |
117 dict->SetInteger(kKeyBluetoothType, static_cast<int>(data.bluetooth_type)); | 117 dict->SetInteger(kKeyBluetoothType, static_cast<int>(data.bluetooth_type)); |
118 dict->SetString(kKeyPsk, data.psk); | 118 dict->SetString(kKeyPsk, data.psk); |
119 std::unique_ptr<base::DictionaryValue> permit_record( | 119 std::unique_ptr<base::DictionaryValue> permit_record( |
120 new base::DictionaryValue); | 120 new base::DictionaryValue); |
121 dict->Set(kKeyPermitRecord, permit_record.release()); | 121 dict->Set(kKeyPermitRecord, std::move(permit_record)); |
122 dict->SetString(kKeyPermitId, data.public_key); | 122 dict->SetString(kKeyPermitId, data.public_key); |
123 dict->SetString(kKeyPermitData, data.public_key); | 123 dict->SetString(kKeyPermitData, data.public_key); |
124 dict->SetString(kKeyPermitType, kPermitTypeLicence); | 124 dict->SetString(kKeyPermitType, kPermitTypeLicence); |
125 dict->SetString(kKeyPermitPermitId, | 125 dict->SetString(kKeyPermitPermitId, |
126 base::StringPrintf(kPermitPermitIdFormat, | 126 base::StringPrintf(kPermitPermitIdFormat, |
127 account_id.GetUserEmail().c_str())); | 127 account_id.GetUserEmail().c_str())); |
128 } | 128 } |
129 | 129 |
130 // static | 130 // static |
131 bool EasyUnlockKeyManager::RemoteDeviceDictionaryToDeviceData( | 131 bool EasyUnlockKeyManager::RemoteDeviceDictionaryToDeviceData( |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 const EasyUnlockDeviceKeyDataList& fetched_data) { | 234 const EasyUnlockDeviceKeyDataList& fetched_data) { |
235 if (!callback.is_null()) | 235 if (!callback.is_null()) |
236 callback.Run(fetch_success, fetched_data); | 236 callback.Run(fetch_success, fetched_data); |
237 | 237 |
238 DCHECK(pending_read_operation_); | 238 DCHECK(pending_read_operation_); |
239 pending_read_operation_.reset(); | 239 pending_read_operation_.reset(); |
240 RunNextOperation(); | 240 RunNextOperation(); |
241 } | 241 } |
242 | 242 |
243 } // namespace chromeos | 243 } // namespace chromeos |
OLD | NEW |