OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_DATA_TYPE_CONTROLLER_H
__ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_DATA_TYPE_CONTROLLER_H
__ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_DATA_TYPE_CONTROLLER_H
__ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_DATA_TYPE_CONTROLLER_H
__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "components/sync/driver/non_ui_data_type_controller.h" | 14 #include "components/sync/driver/async_directory_type_controller.h" |
15 | 15 |
16 namespace autofill { | 16 namespace autofill { |
17 class AutofillWebDataService; | 17 class AutofillWebDataService; |
18 } // namespace autofill | 18 } // namespace autofill |
19 | 19 |
20 namespace browser_sync { | 20 namespace browser_sync { |
21 | 21 |
22 // A class that manages the startup and shutdown of autofill sync. | 22 // A class that manages the startup and shutdown of autofill sync. |
23 class AutofillDataTypeController : public syncer::NonUIDataTypeController { | 23 class AutofillDataTypeController : public syncer::AsyncDirectoryTypeController { |
24 public: | 24 public: |
25 // |dump_stack| is called when an unrecoverable error occurs. | 25 // |dump_stack| is called when an unrecoverable error occurs. |
26 AutofillDataTypeController( | 26 AutofillDataTypeController( |
27 scoped_refptr<base::SingleThreadTaskRunner> db_thread, | 27 scoped_refptr<base::SingleThreadTaskRunner> db_thread, |
28 const base::Closure& dump_stack, | 28 const base::Closure& dump_stack, |
29 syncer::SyncClient* sync_client, | 29 syncer::SyncClient* sync_client, |
30 const scoped_refptr<autofill::AutofillWebDataService>& web_data_service); | 30 const scoped_refptr<autofill::AutofillWebDataService>& web_data_service); |
31 ~AutofillDataTypeController() override; | 31 ~AutofillDataTypeController() override; |
32 | 32 |
33 protected: | 33 protected: |
34 // NonUIDataTypeController implementation. | 34 // AsyncDirectoryTypeController implementation. |
35 bool StartModels() override; | 35 bool StartModels() override; |
36 | 36 |
37 private: | 37 private: |
38 friend class AutofillDataTypeControllerTest; | 38 friend class AutofillDataTypeControllerTest; |
39 FRIEND_TEST_ALL_PREFIXES(AutofillDataTypeControllerTest, StartWDSReady); | 39 FRIEND_TEST_ALL_PREFIXES(AutofillDataTypeControllerTest, StartWDSReady); |
40 FRIEND_TEST_ALL_PREFIXES(AutofillDataTypeControllerTest, StartWDSNotReady); | 40 FRIEND_TEST_ALL_PREFIXES(AutofillDataTypeControllerTest, StartWDSNotReady); |
41 | 41 |
42 // Callback once WebDatabase has loaded. | 42 // Callback once WebDatabase has loaded. |
43 void WebDatabaseLoaded(); | 43 void WebDatabaseLoaded(); |
44 | 44 |
45 // A reference to the AutofillWebDataService for this controller. | 45 // A reference to the AutofillWebDataService for this controller. |
46 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; | 46 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; |
47 | 47 |
48 DISALLOW_COPY_AND_ASSIGN(AutofillDataTypeController); | 48 DISALLOW_COPY_AND_ASSIGN(AutofillDataTypeController); |
49 }; | 49 }; |
50 | 50 |
51 } // namespace browser_sync | 51 } // namespace browser_sync |
52 | 52 |
53 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_DATA_TYPE_CONTROLLE
R_H__ | 53 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_DATA_TYPE_CONTROLLE
R_H__ |
OLD | NEW |