Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: components/sync/device_info/device_info_tracker.h

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_TRACKER_H_ 5 #ifndef COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_TRACKER_H_
6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_TRACKER_H_ 6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_TRACKER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "components/sync/device_info/device_info.h" 11 #include "components/sync/device_info/device_info.h"
12 12
13 namespace syncer { 13 namespace sync_driver {
14 14
15 // Interface for tracking synced DeviceInfo. 15 // Interface for tracking synced DeviceInfo.
16 class DeviceInfoTracker { 16 class DeviceInfoTracker {
17 public: 17 public:
18 virtual ~DeviceInfoTracker() {} 18 virtual ~DeviceInfoTracker() {}
19 19
20 // Observer class for listening to device info changes. 20 // Observer class for listening to device info changes.
21 class Observer { 21 class Observer {
22 public: 22 public:
23 virtual void OnDeviceInfoChange() = 0; 23 virtual void OnDeviceInfoChange() = 0;
24 }; 24 };
25 25
26 // Returns true when DeviceInfo datatype is enabled and syncing. 26 // Returns true when DeviceInfo datatype is enabled and syncing.
27 virtual bool IsSyncing() const = 0; 27 virtual bool IsSyncing() const = 0;
28 // Gets DeviceInfo the synced device with specified client ID. 28 // Gets DeviceInfo the synced device with specified client ID.
29 // Returns an empty unique_ptr if device with the given |client_id| hasn't 29 // Returns an empty unique_ptr if device with the given |client_id| hasn't
30 // been synced. 30 // been synced.
31 virtual std::unique_ptr<DeviceInfo> GetDeviceInfo( 31 virtual std::unique_ptr<DeviceInfo> GetDeviceInfo(
32 const std::string& client_id) const = 0; 32 const std::string& client_id) const = 0;
33 // Gets DeviceInfo for all synced devices (including the local one). 33 // Gets DeviceInfo for all synced devices (including the local one).
34 virtual std::vector<std::unique_ptr<DeviceInfo>> GetAllDeviceInfo() const = 0; 34 virtual std::vector<std::unique_ptr<DeviceInfo>> GetAllDeviceInfo() const = 0;
35 // Registers an observer to be called on syncing any updated DeviceInfo. 35 // Registers an observer to be called on syncing any updated DeviceInfo.
36 virtual void AddObserver(Observer* observer) = 0; 36 virtual void AddObserver(Observer* observer) = 0;
37 // Unregisters an observer. 37 // Unregisters an observer.
38 virtual void RemoveObserver(Observer* observer) = 0; 38 virtual void RemoveObserver(Observer* observer) = 0;
39 // Returns the count of active devices. 39 // Returns the count of active devices.
40 virtual int CountActiveDevices() const = 0; 40 virtual int CountActiveDevices() const = 0;
41 }; 41 };
42 42
43 } // namespace syncer 43 } // namespace sync_driver
44 44
45 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_TRACKER_H_ 45 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_TRACKER_H_
OLDNEW
« no previous file with comments | « components/sync/device_info/device_info_sync_service_unittest.cc ('k') | components/sync/device_info/device_info_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698