| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 // static | 178 // static |
| 179 bool EasyUnlockKeyManager::RemoteDeviceListToDeviceDataList( | 179 bool EasyUnlockKeyManager::RemoteDeviceListToDeviceDataList( |
| 180 const base::ListValue& device_list, | 180 const base::ListValue& device_list, |
| 181 EasyUnlockDeviceKeyDataList* data_list) { | 181 EasyUnlockDeviceKeyDataList* data_list) { |
| 182 EasyUnlockDeviceKeyDataList parsed_devices; | 182 EasyUnlockDeviceKeyDataList parsed_devices; |
| 183 for (base::ListValue::const_iterator it = device_list.begin(); | 183 for (base::ListValue::const_iterator it = device_list.begin(); |
| 184 it != device_list.end(); | 184 it != device_list.end(); |
| 185 ++it) { | 185 ++it) { |
| 186 const base::DictionaryValue* dict; | 186 const base::DictionaryValue* dict; |
| 187 if (!(*it)->GetAsDictionary(&dict) || !dict) | 187 if (!it->GetAsDictionary(&dict) || !dict) |
| 188 return false; | 188 return false; |
| 189 | 189 |
| 190 EasyUnlockDeviceKeyData data; | 190 EasyUnlockDeviceKeyData data; |
| 191 if (!RemoteDeviceDictionaryToDeviceData(*dict, &data)) | 191 if (!RemoteDeviceDictionaryToDeviceData(*dict, &data)) |
| 192 return false; | 192 return false; |
| 193 | 193 |
| 194 parsed_devices.push_back(data); | 194 parsed_devices.push_back(data); |
| 195 } | 195 } |
| 196 | 196 |
| 197 data_list->swap(parsed_devices); | 197 data_list->swap(parsed_devices); |
| (...skipping 36 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 |