OLD | NEW |
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_DRIVER_DEVICE_INFO_SYNC_SERVICE_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SYNC_SERVICE_H_ |
6 #define COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SYNC_SERVICE_H_ | 6 #define COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SYNC_SERVICE_H_ |
7 | 7 |
8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
9 #include "components/sync_driver/device_info_tracker.h" | 9 #include "components/sync_driver/device_info_tracker.h" |
10 #include "sync/api/sync_change_processor.h" | 10 #include "sync/api/sync_change_processor.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 public: | 22 public: |
23 explicit DeviceInfoSyncService( | 23 explicit DeviceInfoSyncService( |
24 LocalDeviceInfoProvider* local_device_info_provider); | 24 LocalDeviceInfoProvider* local_device_info_provider); |
25 virtual ~DeviceInfoSyncService(); | 25 virtual ~DeviceInfoSyncService(); |
26 | 26 |
27 // syncer::SyncableService implementation. | 27 // syncer::SyncableService implementation. |
28 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( | 28 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( |
29 syncer::ModelType type, | 29 syncer::ModelType type, |
30 const syncer::SyncDataList& initial_sync_data, | 30 const syncer::SyncDataList& initial_sync_data, |
31 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 31 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
32 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; | 32 scoped_ptr<syncer::SyncErrorFactory> error_handler) override; |
33 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; | 33 virtual void StopSyncing(syncer::ModelType type) override; |
34 virtual syncer::SyncDataList GetAllSyncData( | 34 virtual syncer::SyncDataList GetAllSyncData( |
35 syncer::ModelType type) const OVERRIDE; | 35 syncer::ModelType type) const override; |
36 virtual syncer::SyncError ProcessSyncChanges( | 36 virtual syncer::SyncError ProcessSyncChanges( |
37 const tracked_objects::Location& from_here, | 37 const tracked_objects::Location& from_here, |
38 const syncer::SyncChangeList& change_list) OVERRIDE; | 38 const syncer::SyncChangeList& change_list) override; |
39 | 39 |
40 // DeviceInfoTracker implementation. | 40 // DeviceInfoTracker implementation. |
41 virtual scoped_ptr<DeviceInfo> GetDeviceInfo( | 41 virtual scoped_ptr<DeviceInfo> GetDeviceInfo( |
42 const std::string& client_id) const OVERRIDE; | 42 const std::string& client_id) const override; |
43 virtual ScopedVector<DeviceInfo> GetAllDeviceInfo() const OVERRIDE; | 43 virtual ScopedVector<DeviceInfo> GetAllDeviceInfo() const override; |
44 virtual void AddObserver(Observer* observer) OVERRIDE; | 44 virtual void AddObserver(Observer* observer) override; |
45 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 45 virtual void RemoveObserver(Observer* observer) override; |
46 | 46 |
47 // Called to update local device backup time. | 47 // Called to update local device backup time. |
48 void UpdateLocalDeviceBackupTime(base::Time backup_time); | 48 void UpdateLocalDeviceBackupTime(base::Time backup_time); |
49 // Gets the most recently set local device backup time. | 49 // Gets the most recently set local device backup time. |
50 base::Time GetLocalDeviceBackupTime() const; | 50 base::Time GetLocalDeviceBackupTime() const; |
51 | 51 |
52 private: | 52 private: |
53 // Create SyncData from local DeviceInfo and |local_device_backup_time_|. | 53 // Create SyncData from local DeviceInfo and |local_device_backup_time_|. |
54 syncer::SyncData CreateLocalData(const DeviceInfo* info); | 54 syncer::SyncData CreateLocalData(const DeviceInfo* info); |
55 // Create SyncData from EntitySpecifics. | 55 // Create SyncData from EntitySpecifics. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 // Registered observers, not owned. | 100 // Registered observers, not owned. |
101 ObserverList<Observer, true> observers_; | 101 ObserverList<Observer, true> observers_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(DeviceInfoSyncService); | 103 DISALLOW_COPY_AND_ASSIGN(DeviceInfoSyncService); |
104 }; | 104 }; |
105 | 105 |
106 } // namespace sync_driver | 106 } // namespace sync_driver |
107 | 107 |
108 #endif // COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SYNC_SERVICE_H_ | 108 #endif // COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SYNC_SERVICE_H_ |
OLD | NEW |