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_DEVICE_INFO_DEVICE_INFO_DATA_TYPE_CONTROLLER_H_ | 5 #ifndef COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_DATA_TYPE_CONTROLLER_H_ |
6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_DATA_TYPE_CONTROLLER_H_ | 6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_DATA_TYPE_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "components/sync/device_info/local_device_info_provider.h" | 11 #include "components/sync/device_info/local_device_info_provider.h" |
12 #include "components/sync/driver/ui_data_type_controller.h" | 12 #include "components/sync/driver/ui_data_type_controller.h" |
13 | 13 |
14 namespace sync_driver { | 14 namespace syncer { |
15 | 15 |
16 // DataTypeController for DEVICE_INFO model type. | 16 // DataTypeController for DEVICE_INFO model type. |
17 class DeviceInfoDataTypeController : public UIDataTypeController { | 17 class DeviceInfoDataTypeController : public UIDataTypeController { |
18 public: | 18 public: |
19 // |dump_stack| is called when an unrecoverable error occurs. | 19 // |dump_stack| is called when an unrecoverable error occurs. |
20 DeviceInfoDataTypeController( | 20 DeviceInfoDataTypeController( |
21 const base::Closure& dump_stack, | 21 const base::Closure& dump_stack, |
22 SyncClient* sync_client, | 22 SyncClient* sync_client, |
23 LocalDeviceInfoProvider* local_device_info_provider); | 23 LocalDeviceInfoProvider* local_device_info_provider); |
24 ~DeviceInfoDataTypeController() override; | 24 ~DeviceInfoDataTypeController() override; |
25 | 25 |
26 private: | 26 private: |
27 // UIDataTypeController implementations. | 27 // UIDataTypeController implementations. |
28 bool StartModels() override; | 28 bool StartModels() override; |
29 void StopModels() override; | 29 void StopModels() override; |
30 | 30 |
31 // Called by LocalDeviceInfoProvider when the local device into becomes | 31 // Called by LocalDeviceInfoProvider when the local device into becomes |
32 // available. | 32 // available. |
33 void OnLocalDeviceInfoLoaded(); | 33 void OnLocalDeviceInfoLoaded(); |
34 | 34 |
35 LocalDeviceInfoProvider* const local_device_info_provider_; | 35 LocalDeviceInfoProvider* const local_device_info_provider_; |
36 std::unique_ptr<LocalDeviceInfoProvider::Subscription> subscription_; | 36 std::unique_ptr<LocalDeviceInfoProvider::Subscription> subscription_; |
37 DISALLOW_COPY_AND_ASSIGN(DeviceInfoDataTypeController); | 37 DISALLOW_COPY_AND_ASSIGN(DeviceInfoDataTypeController); |
38 }; | 38 }; |
39 | 39 |
40 } // namespace sync_driver | 40 } // namespace syncer |
41 | 41 |
42 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_DATA_TYPE_CONTROLLER_H_ | 42 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_DATA_TYPE_CONTROLLER_H_ |
OLD | NEW |