| 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/sync/device_info/device_info_service.h" | 5 #include "components/sync/device_info/device_info_service.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 std::unique_ptr<DeviceInfo> DeviceInfoService::GetDeviceInfo( | 223 std::unique_ptr<DeviceInfo> DeviceInfoService::GetDeviceInfo( |
| 224 const std::string& client_id) const { | 224 const std::string& client_id) const { |
| 225 const ClientIdToSpecifics::const_iterator iter = all_data_.find(client_id); | 225 const ClientIdToSpecifics::const_iterator iter = all_data_.find(client_id); |
| 226 if (iter == all_data_.end()) { | 226 if (iter == all_data_.end()) { |
| 227 return std::unique_ptr<DeviceInfo>(); | 227 return std::unique_ptr<DeviceInfo>(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 return CopyToModel(*iter->second); | 230 return CopyToModel(*iter->second); |
| 231 } | 231 } |
| 232 | 232 |
| 233 ScopedVector<DeviceInfo> DeviceInfoService::GetAllDeviceInfo() const { | 233 std::vector<std::unique_ptr<DeviceInfo>> DeviceInfoService::GetAllDeviceInfo() |
| 234 ScopedVector<DeviceInfo> list; | 234 const { |
| 235 std::vector<std::unique_ptr<DeviceInfo>> list; |
| 235 | 236 |
| 236 for (ClientIdToSpecifics::const_iterator iter = all_data_.begin(); | 237 for (ClientIdToSpecifics::const_iterator iter = all_data_.begin(); |
| 237 iter != all_data_.end(); ++iter) { | 238 iter != all_data_.end(); ++iter) { |
| 238 list.push_back(CopyToModel(*iter->second)); | 239 list.push_back(CopyToModel(*iter->second)); |
| 239 } | 240 } |
| 240 | 241 |
| 241 return list; | 242 return list; |
| 242 } | 243 } |
| 243 | 244 |
| 244 void DeviceInfoService::AddObserver(Observer* observer) { | 245 void DeviceInfoService::AddObserver(Observer* observer) { |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 Time DeviceInfoService::GetLastUpdateTime( | 529 Time DeviceInfoService::GetLastUpdateTime( |
| 529 const DeviceInfoSpecifics& specifics) { | 530 const DeviceInfoSpecifics& specifics) { |
| 530 if (specifics.has_last_updated_timestamp()) { | 531 if (specifics.has_last_updated_timestamp()) { |
| 531 return syncer::ProtoTimeToTime(specifics.last_updated_timestamp()); | 532 return syncer::ProtoTimeToTime(specifics.last_updated_timestamp()); |
| 532 } else { | 533 } else { |
| 533 return Time(); | 534 return Time(); |
| 534 } | 535 } |
| 535 } | 536 } |
| 536 | 537 |
| 537 } // namespace sync_driver_v2 | 538 } // namespace sync_driver_v2 |
| OLD | NEW |