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_PROFILE_DATA_TYPE_CONTROLLER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/scoped_observer.h"
11 #include "components/autofill/core/browser/personal_data_manager_observer.h"
12 #include "components/sync_driver/non_ui_data_type_controller.h"
15 class ProfileSyncComponentsFactory;
18 class PersonalDataManager;
19 } // namespace autofill
21 namespace browser_sync {
23 class AutofillProfileDataTypeController
24 : public NonUIDataTypeController,
25 public autofill::PersonalDataManagerObserver {
27 AutofillProfileDataTypeController(
28 ProfileSyncComponentsFactory* profile_sync_factory,
30 const DisableTypeCallback& disable_callback);
32 // NonUIDataTypeController implementation.
33 virtual syncer::ModelType type() const OVERRIDE;
34 virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE;
36 // PersonalDataManagerObserver implementation:
37 virtual void OnPersonalDataChanged() OVERRIDE;
40 virtual ~AutofillProfileDataTypeController();
42 // NonUIDataTypeController implementation.
43 virtual bool PostTaskOnBackendThread(
44 const tracked_objects::Location& from_here,
45 const base::Closure& task) OVERRIDE;
46 virtual bool StartModels() OVERRIDE;
47 virtual void StopModels() OVERRIDE;
50 // Callback to notify that WebDatabase has loaded.
51 void WebDatabaseLoaded();
53 Profile* const profile_;
54 autofill::PersonalDataManager* personal_data_;
55 bool callback_registered_;
57 DISALLOW_COPY_AND_ASSIGN(AutofillProfileDataTypeController);
60 } // namespace browser_sync
62 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_