| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SERVICE_H_ | 5 #ifndef COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ |
| 6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ | 6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "base/timer/timer.h" | 19 #include "base/timer/timer.h" |
| 20 #include "components/sync/device_info/device_info_tracker.h" | 20 #include "components/sync/device_info/device_info_tracker.h" |
| 21 #include "components/sync/device_info/local_device_info_provider.h" | 21 #include "components/sync/device_info/local_device_info_provider.h" |
| 22 #include "components/sync/model/model_type_service.h" | 22 #include "components/sync/model/model_type_service.h" |
| 23 #include "components/sync/model/model_type_store.h" | 23 #include "components/sync/model/model_type_store.h" |
| 24 #include "components/sync/model/simple_metadata_change_list.h" | 24 #include "components/sync/model/simple_metadata_change_list.h" |
| 25 | 25 |
| 26 namespace syncer { | |
| 27 class SyncError; | |
| 28 } // namespace syncer | |
| 29 | |
| 30 namespace syncer { | |
| 31 class ModelTypeChangeProcessor; | |
| 32 } // namespace syncer | |
| 33 | |
| 34 namespace sync_pb { | 26 namespace sync_pb { |
| 35 class DeviceInfoSpecifics; | 27 class DeviceInfoSpecifics; |
| 36 } // namespace sync_pb | 28 } // namespace sync_pb |
| 37 | 29 |
| 38 namespace syncer { | 30 namespace syncer { |
| 39 | 31 |
| 32 class ModelTypeChangeProcessor; |
| 33 class SyncError; |
| 34 |
| 40 // USS service implementation for DEVICE_INFO model type. Handles storage of | 35 // USS service implementation for DEVICE_INFO model type. Handles storage of |
| 41 // device info and associated sync metadata, applying/merging foreign changes, | 36 // device info and associated sync metadata, applying/merging foreign changes, |
| 42 // and allows public read access. | 37 // and allows public read access. |
| 43 class DeviceInfoService : public ModelTypeService, public DeviceInfoTracker { | 38 class DeviceInfoService : public ModelTypeService, public DeviceInfoTracker { |
| 44 public: | 39 public: |
| 45 typedef base::Callback<void(const ModelTypeStore::InitCallback& callback)> | 40 typedef base::Callback<void(const ModelTypeStore::InitCallback& callback)> |
| 46 StoreFactoryFunction; | 41 StoreFactoryFunction; |
| 47 | 42 |
| 48 DeviceInfoService(LocalDeviceInfoProvider* local_device_info_provider, | 43 DeviceInfoService(LocalDeviceInfoProvider* local_device_info_provider, |
| 49 const StoreFactoryFunction& callback, | 44 const StoreFactoryFunction& callback, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 164 |
| 170 // Used to update our local device info once every pulse interval. | 165 // Used to update our local device info once every pulse interval. |
| 171 base::OneShotTimer pulse_timer_; | 166 base::OneShotTimer pulse_timer_; |
| 172 | 167 |
| 173 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService); | 168 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService); |
| 174 }; | 169 }; |
| 175 | 170 |
| 176 } // namespace syncer | 171 } // namespace syncer |
| 177 | 172 |
| 178 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ | 173 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ |
| OLD | NEW |