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

Side by Side Diff: chrome/browser/sync/glue/device_info_tracker.h

Issue 430583003: Refactor syncable DEVICE_INFO type from ChangeProcessor to SyncableService - Part 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback, added DeviceInfoTracker interface. Created 6 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_TRACKER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_TRACKER_H_
7
8 #include "base/callback_list.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h"
11 #include "chrome/browser/sync/glue/device_info.h"
12
13 namespace browser_sync {
14
15 // Interface for tracking synced DeviceInfo.
16 class DeviceInfoTracker {
17 public:
18 typedef base::CallbackList<void(void)>::Subscription Subscription;
19
20 virtual ~DeviceInfoTracker() {}
21
22 // Gets DeviceInfo the synced device with specified client ID.
23 // Returns an empty scoped_ptr if device with the given |client_id| hasn't
24 // been synced.
25 virtual scoped_ptr<DeviceInfo> GetDeviceInfo(
26 const std::string& client_id) const = 0;
27 // Gets DeviceInfo for all synced devices (including the local one).
28 virtual ScopedVector<DeviceInfo> GetAllDeviceInfo() const = 0;
29 // Registers an observer callback to be called on syncing any updated
30 // DeviceInfo. The callback remains registered until the returned
31 // Subscription is destroyed, which must occur before this object
32 // is destroyed.
33 virtual scoped_ptr<Subscription> RegisterOnDeviceInfoChangedCallback(
34 const base::Closure& callback) = 0;
35 };
36
37 } // namespace browser_sync
38
39 #endif // CHROME_BROWSER_SYNC_GLUE_DEVICE_INFO_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698