OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_SEARCH_ENGINES_SEARCH_ENGINE_DATA_TYPE_CONTROLLER_H__ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_DATA_TYPE_CONTROLLER_H__ |
6 #define COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_DATA_TYPE_CONTROLLER_H__ | 6 #define COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_DATA_TYPE_CONTROLLER_H__ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "components/search_engines/template_url_service.h" | 12 #include "components/search_engines/template_url_service.h" |
13 #include "components/sync/driver/ui_data_type_controller.h" | 13 #include "components/sync/driver/ui_data_type_controller.h" |
14 | 14 |
15 class Profile; | 15 class Profile; |
16 | 16 |
17 namespace browser_sync { | 17 namespace browser_sync { |
18 | 18 |
19 // Controller for the SEARCH_ENGINES sync data type. This class tells sync | 19 // Controller for the SEARCH_ENGINES sync data type. This class tells sync |
20 // how to load the model for this data type, and the superclasses manage | 20 // how to load the model for this data type, and the superclasses manage |
21 // controlling the rest of the state of the datatype with regards to sync. | 21 // controlling the rest of the state of the datatype with regards to sync. |
22 class SearchEngineDataTypeController : public syncer::UIDataTypeController { | 22 class SearchEngineDataTypeController |
| 23 : public sync_driver::UIDataTypeController { |
23 public: | 24 public: |
24 // |dump_stack| is called when an unrecoverable error occurs. | 25 // |dump_stack| is called when an unrecoverable error occurs. |
25 SearchEngineDataTypeController(const base::Closure& dump_stack, | 26 SearchEngineDataTypeController(const base::Closure& dump_stack, |
26 syncer::SyncClient* sync_client, | 27 sync_driver::SyncClient* sync_client, |
27 TemplateURLService* template_url_service); | 28 TemplateURLService* template_url_service); |
28 ~SearchEngineDataTypeController() override; | 29 ~SearchEngineDataTypeController() override; |
29 | 30 |
30 TemplateURLService::Subscription* GetSubscriptionForTesting(); | 31 TemplateURLService::Subscription* GetSubscriptionForTesting(); |
31 | 32 |
32 private: | 33 private: |
33 // FrontendDataTypeController: | 34 // FrontendDataTypeController: |
34 bool StartModels() override; | 35 bool StartModels() override; |
35 void StopModels() override; | 36 void StopModels() override; |
36 | 37 |
37 void OnTemplateURLServiceLoaded(); | 38 void OnTemplateURLServiceLoaded(); |
38 | 39 |
39 // A pointer to the template URL service that this data type will use. | 40 // A pointer to the template URL service that this data type will use. |
40 TemplateURLService* template_url_service_; | 41 TemplateURLService* template_url_service_; |
41 | 42 |
42 // A subscription to the OnLoadedCallback so it can be cleared if necessary. | 43 // A subscription to the OnLoadedCallback so it can be cleared if necessary. |
43 std::unique_ptr<TemplateURLService::Subscription> template_url_subscription_; | 44 std::unique_ptr<TemplateURLService::Subscription> template_url_subscription_; |
44 | 45 |
45 DISALLOW_COPY_AND_ASSIGN(SearchEngineDataTypeController); | 46 DISALLOW_COPY_AND_ASSIGN(SearchEngineDataTypeController); |
46 }; | 47 }; |
47 | 48 |
48 } // namespace browser_sync | 49 } // namespace browser_sync |
49 | 50 |
50 #endif // COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_DATA_TYPE_CONTROLLER_H__ | 51 #endif // COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_DATA_TYPE_CONTROLLER_H__ |
OLD | NEW |