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 "chrome/browser/sync/glue/non_ui_data_type_controller.h"
12 #include "components/autofill/core/browser/personal_data_manager_observer.h"
15 class PersonalDataManager;
16 } // namespace autofill
18 namespace browser_sync {
20 class AutofillProfileDataTypeController
21 : public NonUIDataTypeController,
22 public autofill::PersonalDataManagerObserver {
24 AutofillProfileDataTypeController(
25 ProfileSyncComponentsFactory* profile_sync_factory,
27 ProfileSyncService* sync_service);
29 // NonUIDataTypeController implementation.
30 virtual syncer::ModelType type() const OVERRIDE;
31 virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE;
33 // PersonalDataManagerObserver implementation:
34 virtual void OnPersonalDataChanged() OVERRIDE;
37 virtual ~AutofillProfileDataTypeController();
39 // NonUIDataTypeController implementation.
40 virtual bool PostTaskOnBackendThread(
41 const tracked_objects::Location& from_here,
42 const base::Closure& task) OVERRIDE;
43 virtual bool StartModels() OVERRIDE;
44 virtual void StopModels() OVERRIDE;
47 // Callback to notify that WebDatabase has loaded.
48 void WebDatabaseLoaded();
50 autofill::PersonalDataManager* personal_data_;
51 bool callback_registered_;
53 DISALLOW_COPY_AND_ASSIGN(AutofillProfileDataTypeController);
56 } // namespace browser_sync
58 #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_