OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/signed_in_devices/id_mapping_helper.h" | 5 #include "chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.
h" | 12 #include "chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.
h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "components/crx_file/id_util.h" | 14 #include "components/crx_file/id_util.h" |
15 #include "components/sync/device_info/device_info.h" | 15 #include "components/sync/device_info/device_info.h" |
16 | 16 |
17 using base::DictionaryValue; | 17 using base::DictionaryValue; |
18 using base::Value; | 18 using base::Value; |
19 using sync_driver::DeviceInfo; | 19 using syncer::DeviceInfo; |
20 | 20 |
21 namespace extensions { | 21 namespace extensions { |
22 | 22 |
23 std::string GetPublicIdFromGUID( | 23 std::string GetPublicIdFromGUID( |
24 const base::DictionaryValue& id_mapping, | 24 const base::DictionaryValue& id_mapping, |
25 const std::string& guid) { | 25 const std::string& guid) { |
26 for (base::DictionaryValue::Iterator it(id_mapping); | 26 for (base::DictionaryValue::Iterator it(id_mapping); |
27 !it.IsAtEnd(); | 27 !it.IsAtEnd(); |
28 it.Advance()) { | 28 it.Advance()) { |
29 const base::Value& value = it.value(); | 29 const base::Value& value = it.value(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 for (auto& iter : devices) { | 94 for (auto& iter : devices) { |
95 if (iter->guid() == client_id) { | 95 if (iter->guid() == client_id) { |
96 std::unique_ptr<DeviceInfo> device = std::move(iter); | 96 std::unique_ptr<DeviceInfo> device = std::move(iter); |
97 return device; | 97 return device; |
98 } | 98 } |
99 } | 99 } |
100 return std::unique_ptr<DeviceInfo>(); | 100 return std::unique_ptr<DeviceInfo>(); |
101 } | 101 } |
102 | 102 |
103 } // namespace extensions | 103 } // namespace extensions |
OLD | NEW |