Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_API_H_ _ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_API_H_ _ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_API_H_ _ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_API_H_ _ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
| 12 #include "chrome/browser/extensions/chrome_extension_function.h" | 12 #include "chrome/browser/extensions/chrome_extension_function.h" |
| 13 | 13 #include "chrome/browser/sync/glue/device_info_tracker.h" |
|
pavely
2014/09/17 23:04:38
nit: Please forward declare class instead of inclu
stanisc
2014/09/18 22:46:53
Done.
| |
| 14 namespace browser_sync { | |
| 15 class DeviceInfo; | |
| 16 } // namespace browser_sync | |
| 17 | 14 |
| 18 namespace extensions { | 15 namespace extensions { |
| 19 class ExtensionPrefs; | 16 class ExtensionPrefs; |
| 20 } // namespace extensions | 17 } // namespace extensions |
| 21 | 18 |
| 22 class Profile; | 19 class Profile; |
| 23 class ProfileSyncService; | 20 class ProfileSyncService; |
|
pavely
2014/09/17 23:04:38
ProfileSyncService is not needed anymore
stanisc
2014/09/18 22:46:53
Done.
| |
| 24 | 21 |
| 25 namespace extensions { | 22 namespace extensions { |
| 26 | 23 |
| 27 // Gets the list of signed in devices. The returned scoped vector will be | 24 // Gets the list of signed in devices. The returned scoped vector will be |
| 28 // filled with the list of devices associated with the account signed into this | 25 // filled with the list of devices associated with the account signed into this |
| 29 // |profile|. This function needs the |extension_id| because the | 26 // |profile|. This function needs the |extension_id| because the |
| 30 // public device ids are set per extension. | 27 // public device ids are set per extension. |
| 31 ScopedVector<browser_sync::DeviceInfo> GetAllSignedInDevices( | 28 ScopedVector<browser_sync::DeviceInfo> GetAllSignedInDevices( |
| 32 const std::string& extension_id, | 29 const std::string& extension_id, |
| 33 Profile* profile); | 30 Profile* profile); |
| 34 | 31 |
| 35 ScopedVector<browser_sync::DeviceInfo> GetAllSignedInDevices( | 32 ScopedVector<browser_sync::DeviceInfo> GetAllSignedInDevices( |
| 36 const std::string& extension_id, | 33 const std::string& extension_id, |
| 37 ProfileSyncService* pss, | 34 browser_sync::DeviceInfoTracker* device_tracker, |
| 38 ExtensionPrefs* extension_prefs); | 35 ExtensionPrefs* extension_prefs); |
| 39 | 36 |
| 40 class SignedInDevicesGetFunction : public ChromeSyncExtensionFunction { | 37 class SignedInDevicesGetFunction : public ChromeSyncExtensionFunction { |
| 41 protected: | 38 protected: |
| 42 virtual ~SignedInDevicesGetFunction() {} | 39 virtual ~SignedInDevicesGetFunction() {} |
| 43 | 40 |
| 44 // ExtensionFunction: | 41 // ExtensionFunction: |
| 45 virtual bool RunSync() OVERRIDE; | 42 virtual bool RunSync() OVERRIDE; |
| 46 DECLARE_EXTENSION_FUNCTION("signedInDevices.get", SIGNED_IN_DEVICES_GET) | 43 DECLARE_EXTENSION_FUNCTION("signedInDevices.get", SIGNED_IN_DEVICES_GET) |
| 47 }; | 44 }; |
| 48 | 45 |
| 49 } // namespace extensions | 46 } // namespace extensions |
| 50 | 47 |
| 51 #endif // CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_API _H__ | 48 #endif // CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_API _H__ |
| OLD | NEW |