| 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_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONT
ROLLER_H_ | 5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONT
ROLLER_H_ |
| 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONT
ROLLER_H_ | 6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONT
ROLLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/sync/device_info/local_device_info_provider.h" | 9 #include "components/sync/device_info/local_device_info_provider.h" |
| 10 #include "components/sync/driver/non_ui_data_type_controller.h" | 10 #include "components/sync/driver/async_directory_type_controller.h" |
| 11 #include "components/sync/driver/sync_service_observer.h" | 11 #include "components/sync/driver/sync_service_observer.h" |
| 12 | 12 |
| 13 namespace browser_sync { | 13 namespace browser_sync { |
| 14 | 14 |
| 15 // A controller for delete directives, which cannot sync when full encryption | 15 // A controller for delete directives, which cannot sync when full encryption |
| 16 // is enabled. | 16 // is enabled. |
| 17 class HistoryDeleteDirectivesDataTypeController | 17 class HistoryDeleteDirectivesDataTypeController |
| 18 : public syncer::NonUIDataTypeController, | 18 : public syncer::AsyncDirectoryTypeController, |
| 19 public syncer::SyncServiceObserver { | 19 public syncer::SyncServiceObserver { |
| 20 public: | 20 public: |
| 21 // |dump_stack| is called when an unrecoverable error occurs. | 21 // |dump_stack| is called when an unrecoverable error occurs. |
| 22 HistoryDeleteDirectivesDataTypeController(const base::Closure& dump_stack, | 22 HistoryDeleteDirectivesDataTypeController(const base::Closure& dump_stack, |
| 23 syncer::SyncClient* sync_client); | 23 syncer::SyncClient* sync_client); |
| 24 ~HistoryDeleteDirectivesDataTypeController() override; | 24 ~HistoryDeleteDirectivesDataTypeController() override; |
| 25 | 25 |
| 26 // NonUIDataTypeController override. | 26 // AsyncDirectoryTypeController override. |
| 27 bool ReadyForStart() const override; | 27 bool ReadyForStart() const override; |
| 28 bool StartModels() override; | 28 bool StartModels() override; |
| 29 void StopModels() override; | 29 void StopModels() override; |
| 30 | 30 |
| 31 // syncer::SyncServiceObserver implementation. | 31 // syncer::SyncServiceObserver implementation. |
| 32 void OnStateChanged() override; | 32 void OnStateChanged() override; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 // Triggers a SingleDataTypeUnrecoverable error and returns true if the | 35 // Triggers a SingleDataTypeUnrecoverable error and returns true if the |
| 36 // type is no longer ready, else does nothing and returns false. | 36 // type is no longer ready, else does nothing and returns false. |
| 37 bool DisableTypeIfNecessary(); | 37 bool DisableTypeIfNecessary(); |
| 38 | 38 |
| 39 syncer::SyncClient* sync_client_; | 39 syncer::SyncClient* sync_client_; |
| 40 | 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(HistoryDeleteDirectivesDataTypeController); | 41 DISALLOW_COPY_AND_ASSIGN(HistoryDeleteDirectivesDataTypeController); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 } // namespace browser_sync | 44 } // namespace browser_sync |
| 45 | 45 |
| 46 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_C
ONTROLLER_H_ | 46 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_C
ONTROLLER_H_ |
| OLD | NEW |