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.
5 #ifndef COMPONENTS_SYNC_DRIVER_DEVICE_INFO_DATA_TYPE_CONTROLLER_H_
6 #define COMPONENTS_SYNC_DRIVER_DEVICE_INFO_DATA_TYPE_CONTROLLER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/single_thread_task_runner.h"
10 #include "components/sync_driver/local_device_info_provider.h"
11 #include "components/sync_driver/ui_data_type_controller.h"
13 namespace sync_driver
{
15 // DataTypeController for DEVICE_INFO model type.
16 class DeviceInfoDataTypeController
: public UIDataTypeController
{
18 DeviceInfoDataTypeController(
19 const scoped_refptr
<base::SingleThreadTaskRunner
>& ui_thread
,
20 const base::Closure
& error_callback
,
21 SyncClient
* sync_client
,
22 LocalDeviceInfoProvider
* local_device_info_provider
);
25 ~DeviceInfoDataTypeController() override
;
27 // UIDataTypeController implementations.
28 bool StartModels() override
;
29 void StopModels() override
;
31 // Called by LocalDeviceInfoProvider when the local device into becomes
33 void OnLocalDeviceInfoLoaded();
35 LocalDeviceInfoProvider
* const local_device_info_provider_
;
36 scoped_ptr
<LocalDeviceInfoProvider::Subscription
> subscription_
;
37 DISALLOW_COPY_AND_ASSIGN(DeviceInfoDataTypeController
);
40 } // namespace sync_driver
42 #endif // COMPONENTS_SYNC_DRIVER_DEVICE_INFO_DATA_TYPE_CONTROLLER_H_