Extensions cleanup: Merge IsSyncableApp+Extension, ShouldSyncApp+Extension
[chromium-blink-merge.git] / chrome / browser / extensions / api / signed_in_devices / signed_in_devices_api.h
blob1d1c092233aa0607a90e9b3a7b71f96bc8b12068
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
3 // found in the LICENSE file.
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__
8 #include <string>
9 #include <vector>
11 #include "base/memory/scoped_vector.h"
12 #include "chrome/browser/extensions/chrome_extension_function.h"
14 namespace sync_driver {
15 class DeviceInfo;
16 class DeviceInfoTracker;
17 } // namespace sync_driver
19 namespace extensions {
20 class ExtensionPrefs;
21 } // namespace extensions
23 class Profile;
25 namespace extensions {
27 // 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
29 // |profile|. This function needs the |extension_id| because the
30 // public device ids are set per extension.
31 ScopedVector<sync_driver::DeviceInfo> GetAllSignedInDevices(
32 const std::string& extension_id,
33 Profile* profile);
35 ScopedVector<sync_driver::DeviceInfo> GetAllSignedInDevices(
36 const std::string& extension_id,
37 sync_driver::DeviceInfoTracker* device_tracker,
38 ExtensionPrefs* extension_prefs);
40 class SignedInDevicesGetFunction : public ChromeSyncExtensionFunction {
41 protected:
42 ~SignedInDevicesGetFunction() override {}
44 // ExtensionFunction:
45 bool RunSync() override;
46 DECLARE_EXTENSION_FUNCTION("signedInDevices.get", SIGNED_IN_DEVICES_GET)
49 } // namespace extensions
51 #endif // CHROME_BROWSER_EXTENSIONS_API_SIGNED_IN_DEVICES_SIGNED_IN_DEVICES_API_H__