Chromium Code Reviews| Index: chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.cc |
| diff --git a/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.cc b/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.cc |
| index d48cc0c4f5281811f4969f0cb9c003c6218ae7ad..07752f3b1cd171b4e79d251dddebcd2139894cb4 100644 |
| --- a/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.cc |
| +++ b/chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.cc |
| @@ -9,7 +9,7 @@ |
| #include "base/values.h" |
| #include "chrome/browser/extensions/api/signed_in_devices/id_mapping_helper.h" |
| #include "chrome/browser/profiles/profile.h" |
| -#include "chrome/browser/sync/glue/device_info.h" |
| +#include "chrome/browser/sync/glue/device_info_tracker.h" |
| #include "chrome/browser/sync/glue/local_device_info_provider.h" |
| #include "chrome/browser/sync/profile_sync_service.h" |
| #include "chrome/browser/sync/profile_sync_service_factory.h" |
| @@ -18,6 +18,7 @@ |
| using base::DictionaryValue; |
| using browser_sync::DeviceInfo; |
| +using browser_sync::DeviceInfoTracker; |
| using browser_sync::LocalDeviceInfoProvider; |
| namespace extensions { |
| @@ -48,13 +49,13 @@ const base::DictionaryValue* GetIdMappingDictionary( |
| } |
| // Helper routine to get all signed in devices. The helper takes in |
| -// the pointers for |ProfileSyncService| and |Extensionprefs|. This |
| +// the pointers for |DeviceInfoTracker| and |Extensionprefs|. This |
| // makes it easier to test by passing mock values for these pointers. |
| ScopedVector<DeviceInfo> GetAllSignedInDevices( |
| const std::string& extension_id, |
| - ProfileSyncService* pss, |
| + DeviceInfoTracker* device_tracker, |
| ExtensionPrefs* extension_prefs) { |
| - ScopedVector<DeviceInfo> devices = pss->GetAllSignedInDevices(); |
| + ScopedVector<DeviceInfo> devices = device_tracker->GetAllDeviceInfo(); |
| const base::DictionaryValue* mapping_dictionary = GetIdMappingDictionary( |
| extension_prefs, |
| extension_id); |
| @@ -78,14 +79,13 @@ ScopedVector<DeviceInfo> GetAllSignedInDevices( |
| ScopedVector<DeviceInfo> GetAllSignedInDevices( |
| const std::string& extension_id, |
| Profile* profile) { |
| - // Get the profile sync service and extension prefs pointers |
| + // Get the device tracker and extension prefs pointers |
| // and call the helper. |
| - ProfileSyncService* pss = ProfileSyncServiceFactory::GetForProfile(profile); |
| + DeviceInfoTracker* device_tracker = |
| + ProfileSyncServiceFactory::GetForProfile(profile)->GetDeviceInfoTracker(); |
|
pavely
2014/09/17 23:04:38
What is the condition when GetDeviceInfoTracker()
stanisc
2014/09/18 22:46:53
Good catch! It could only be null if either Sync b
|
| ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(profile); |
| - return GetAllSignedInDevices(extension_id, |
| - pss, |
| - extension_prefs); |
| + return GetAllSignedInDevices(extension_id, device_tracker, extension_prefs); |
| } |
| scoped_ptr<DeviceInfo> GetLocalDeviceInfo(const std::string& extension_id, |