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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_DATA_TYPE_CONTROLLER_H__
6 #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_DATA_TYPE_CONTROLLER_H__
10 #include "base/compiler_specific.h"
11 #include "base/gtest_prod_util.h"
12 #include "base/memory/ref_counted.h"
13 #include "components/sync_driver/non_ui_data_type_controller.h"
16 class ProfileSyncComponentsFactory;
19 class AutofillWebDataService;
20 } // namespace autofill
22 namespace browser_sync {
24 // A class that manages the startup and shutdown of autofill sync.
25 class AutofillDataTypeController
26 : public sync_driver::NonUIDataTypeController {
28 AutofillDataTypeController(
29 ProfileSyncComponentsFactory* profile_sync_factory,
32 // NonUIDataTypeController implementation.
33 virtual syncer::ModelType type() const OVERRIDE;
34 virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE;
36 // NonFrontendDatatypeController override, needed as stop-gap until bug
37 // 163431 is addressed / implemented.
38 virtual void StartAssociating(const StartCallback& start_callback) OVERRIDE;
41 virtual ~AutofillDataTypeController();
43 // NonUIDataTypeController implementation.
44 virtual bool PostTaskOnBackendThread(
45 const tracked_objects::Location& from_here,
46 const base::Closure& task) OVERRIDE;
47 virtual bool StartModels() OVERRIDE;
50 friend class AutofillDataTypeControllerTest;
51 FRIEND_TEST_ALL_PREFIXES(AutofillDataTypeControllerTest, StartWDSReady);
52 FRIEND_TEST_ALL_PREFIXES(AutofillDataTypeControllerTest, StartWDSNotReady);
54 // Callback once WebDatabase has loaded.
55 void WebDatabaseLoaded();
57 Profile* const profile_;
59 DISALLOW_COPY_AND_ASSIGN(AutofillDataTypeController);
62 } // namespace browser_sync
64 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_DATA_TYPE_CONTROLLER_H__