#ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_
#define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_PROFILE_DATA_TYPE_CONTROLLER_H_
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/scoped_observer.h"
#include "chrome/browser/sync/glue/non_ui_data_type_controller.h"
#include "components/autofill/core/browser/personal_data_manager_observer.h"
namespace autofill {
class PersonalDataManager;
}
namespace browser_sync {
class AutofillProfileDataTypeController
: public NonUIDataTypeController,
public autofill::PersonalDataManagerObserver {
public:
AutofillProfileDataTypeController(
ProfileSyncComponentsFactory* profile_sync_factory,
Profile* profile,
ProfileSyncService* sync_service);
virtual syncer::ModelType type() const OVERRIDE;
virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE;
virtual void OnPersonalDataChanged() OVERRIDE;
protected:
virtual ~AutofillProfileDataTypeController();
virtual bool PostTaskOnBackendThread(
const tracked_objects::Location& from_here,
const base::Closure& task) OVERRIDE;
virtual bool StartModels() OVERRIDE;
virtual void StopModels() OVERRIDE;
private:
void WebDatabaseLoaded();
autofill::PersonalDataManager* personal_data_;
bool callback_registered_;
DISALLOW_COPY_AND_ASSIGN(AutofillProfileDataTypeController);
};
}
#endif