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 CHROME_BROWSER_SYNC_GLUE_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONTROLLER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONTROLLER_H_
8 #include "chrome/browser/sync/profile_sync_service_observer.h"
9 #include "components/sync_driver/local_device_info_provider.h"
10 #include "components/sync_driver/ui_data_type_controller.h"
13 class ProfileSyncService;
15 namespace browser_sync {
17 // A controller for delete directives, which cannot sync when full encryption
19 class HistoryDeleteDirectivesDataTypeController
20 : public sync_driver::UIDataTypeController,
21 public ProfileSyncServiceObserver {
23 HistoryDeleteDirectivesDataTypeController(
24 sync_driver::SyncApiComponentFactory* factory,
25 ProfileSyncService* sync_service);
27 // UIDataTypeController override.
28 bool ReadyForStart() const override;
29 bool StartModels() override;
30 void StopModels() override;
32 // ProfileSyncServiceBaseObserver implementation.
33 void OnStateChanged() override;
37 ~HistoryDeleteDirectivesDataTypeController() override;
39 // Triggers a SingleDataTypeUnrecoverable error and returns true if the
40 // type is no longer ready, else does nothing and returns false.
41 bool DisableTypeIfNecessary();
43 ProfileSyncService* sync_service_;
45 DISALLOW_COPY_AND_ASSIGN(HistoryDeleteDirectivesDataTypeController);
48 } // namespace browser_sync
50 #endif // CHROME_BROWSER_SYNC_GLUE_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONTROLLER_H_