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/signed_in_devices_api.
h" | 5 #include "chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.
h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 return std::vector<std::unique_ptr<DeviceInfo>>(); | 92 return std::vector<std::unique_ptr<DeviceInfo>>(); |
93 } | 93 } |
94 | 94 |
95 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(profile); | 95 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(profile); |
96 | 96 |
97 return GetAllSignedInDevices(extension_id, device_tracker, extension_prefs); | 97 return GetAllSignedInDevices(extension_id, device_tracker, extension_prefs); |
98 } | 98 } |
99 | 99 |
100 std::unique_ptr<DeviceInfo> GetLocalDeviceInfo(const std::string& extension_id, | 100 std::unique_ptr<DeviceInfo> GetLocalDeviceInfo(const std::string& extension_id, |
101 Profile* profile) { | 101 Profile* profile) { |
102 ProfileSyncService* pss = ProfileSyncServiceFactory::GetForProfile(profile); | 102 browser_sync::ProfileSyncService* pss = |
| 103 ProfileSyncServiceFactory::GetForProfile(profile); |
103 if (!pss) { | 104 if (!pss) { |
104 return std::unique_ptr<DeviceInfo>(); | 105 return std::unique_ptr<DeviceInfo>(); |
105 } | 106 } |
106 | 107 |
107 LocalDeviceInfoProvider* local_device = pss->GetLocalDeviceInfoProvider(); | 108 LocalDeviceInfoProvider* local_device = pss->GetLocalDeviceInfoProvider(); |
108 DCHECK(local_device); | 109 DCHECK(local_device); |
109 std::string guid = local_device->GetLocalSyncCacheGUID(); | 110 std::string guid = local_device->GetLocalSyncCacheGUID(); |
110 std::unique_ptr<DeviceInfo> device = | 111 std::unique_ptr<DeviceInfo> device = |
111 GetDeviceInfoForClientId(guid, extension_id, profile); | 112 GetDeviceInfoForClientId(guid, extension_id, profile); |
112 return device; | 113 return device; |
(...skipping 24 matching lines...) Expand all Loading... |
137 | 138 |
138 for (const std::unique_ptr<DeviceInfo>& device : devices) | 139 for (const std::unique_ptr<DeviceInfo>& device : devices) |
139 result->Append(device->ToValue()); | 140 result->Append(device->ToValue()); |
140 | 141 |
141 SetResult(std::move(result)); | 142 SetResult(std::move(result)); |
142 return true; | 143 return true; |
143 } | 144 } |
144 | 145 |
145 } // namespace extensions | 146 } // namespace extensions |
146 | 147 |
OLD | NEW |