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

Side by Side Diff: components/sync_driver/device_info_tracker.h

Issue 597423002: Device info datatype should be moved to components/sync_driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor CR feedback addressed. Created 6 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 CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_TRACKER_H_ 5 #ifndef COMPONENTS_SYNC_DRIVER_DEVICE_INFO_TRACKER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_TRACKER_H_ 6 #define COMPONENTS_SYNC_DRIVER_DEVICE_INFO_TRACKER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "chrome/browser/sync/glue/device_info.h" 10 #include "components/sync_driver/device_info.h"
11 11
12 namespace browser_sync { 12 namespace sync_driver {
13 13
14 // Interface for tracking synced DeviceInfo. 14 // Interface for tracking synced DeviceInfo.
15 class DeviceInfoTracker { 15 class DeviceInfoTracker {
16 public: 16 public:
17 virtual ~DeviceInfoTracker() {} 17 virtual ~DeviceInfoTracker() {}
18 18
19 // Observer class for listening to device info changes. 19 // Observer class for listening to device info changes.
20 class Observer { 20 class Observer {
21 public: 21 public:
22 virtual void OnDeviceInfoChange() = 0; 22 virtual void OnDeviceInfoChange() = 0;
23 }; 23 };
24 24
25 // Gets DeviceInfo the synced device with specified client ID. 25 // Gets DeviceInfo the synced device with specified client ID.
26 // Returns an empty scoped_ptr if device with the given |client_id| hasn't 26 // Returns an empty scoped_ptr if device with the given |client_id| hasn't
27 // been synced. 27 // been synced.
28 virtual scoped_ptr<DeviceInfo> GetDeviceInfo( 28 virtual scoped_ptr<DeviceInfo> GetDeviceInfo(
29 const std::string& client_id) const = 0; 29 const std::string& client_id) const = 0;
30 // Gets DeviceInfo for all synced devices (including the local one). 30 // Gets DeviceInfo for all synced devices (including the local one).
31 virtual ScopedVector<DeviceInfo> GetAllDeviceInfo() const = 0; 31 virtual ScopedVector<DeviceInfo> GetAllDeviceInfo() const = 0;
32 // Registers an observer to be called on syncing any updated DeviceInfo. 32 // Registers an observer to be called on syncing any updated DeviceInfo.
33 virtual void AddObserver(Observer* observer) = 0; 33 virtual void AddObserver(Observer* observer) = 0;
34 // Unregisters an observer. 34 // Unregisters an observer.
35 virtual void RemoveObserver(Observer* observer) = 0; 35 virtual void RemoveObserver(Observer* observer) = 0;
36 }; 36 };
37 37
38 } // namespace browser_sync 38 } // namespace sync_driver
39 39
40 #endif // CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_TRACKER_H_ 40 #endif // COMPONENTS_SYNC_DRIVER_DEVICE_INFO_TRACKER_H_
OLDNEW
« no previous file with comments | « components/sync_driver/device_info_sync_service.cc ('k') | components/sync_driver/local_device_info_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698