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

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

Issue 10911073: NOT FOR COMMIT: Add DeviceInfo type and ChangeProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix several issues Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_SYNCED_DEVICE_TRACKER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_SYNCED_DEVICE_TRACKER_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/sync/glue/change_processor.h"
13 #include "sync/protocol/sync.pb.h"
14
15 namespace browser_sync {
16
17 class DeviceInfo;
18
19 class SyncedDeviceTracker : public ChangeProcessor {
20 public:
21 SyncedDeviceTracker();
22 virtual ~SyncedDeviceTracker();
23
24 // ChangeProcessor methods
25 virtual void StartImpl(Profile* profile) OVERRIDE;
26 virtual void StopImpl() OVERRIDE;
27 virtual void ApplyChangesFromSyncModel(
28 const syncer::BaseTransaction* trans,
29 const syncer::ImmutableChangeRecordList& changes) OVERRIDE;
30 virtual void CommitChangesFromSyncModel() OVERRIDE;
31
32 // Methods for accessing and updating the device_info list.
33 // These are virtual for testing.
34 virtual bool ReadLocalDeviceInfo(const syncer::BaseTransaction &trans,
35 DeviceInfo* out);
36 virtual bool ReadLocalDeviceInfo(DeviceInfo* out);
37 virtual void InitLocalDeviceInfo(const base::Closure& callback);
38
39 private:
40 friend class SyncedDeviceTrackerTest;
41
42 void InitLocalDeviceInfoContinuation(const base::Closure& callback,
43 const DeviceInfo& local_info);
44
45 // Helper to write specifics into our node. Also useful for testing.
46 void WriteLocalDeviceInfo(const DeviceInfo& info);
47
48 base::WeakPtrFactory<SyncedDeviceTracker> weak_factory_;
49
50 DISALLOW_COPY_AND_ASSIGN(SyncedDeviceTracker);
51 };
52
53 } // namespace browser_sync
54
55 #endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_DEVICE_TRACKER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_registrar.cc ('k') | chrome/browser/sync/glue/synced_device_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698