Index: chrome/browser/sync/glue/autofill_data_type_controller.h |
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.h b/chrome/browser/sync/glue/autofill_data_type_controller.h |
index 8df5fb8e1ba0aea76fb8531eea1511e7bc501390..237099eb7a3bbc5a8c54f30018ea72052d4e0560 100644 |
--- a/chrome/browser/sync/glue/autofill_data_type_controller.h |
+++ b/chrome/browser/sync/glue/autofill_data_type_controller.h |
@@ -8,25 +8,20 @@ |
#include <string> |
-#include "base/basictypes.h" |
-#include "base/memory/scoped_ptr.h" |
-#include "base/synchronization/waitable_event.h" |
+#include "base/memory/ref_counted.h" |
#include "chrome/browser/autofill/personal_data_manager.h" |
-#include "chrome/browser/sync/profile_sync_factory.h" |
-#include "chrome/browser/sync/profile_sync_service.h" |
-#include "chrome/browser/sync/glue/data_type_controller.h" |
+#include "chrome/browser/sync/glue/non_frontend_data_type_controller.h" |
tim (not reviewing)
2011/04/07 22:04:25
i know it's a bit late now but.. maybe in a follow
Nicolas Zea
2011/04/08 16:53:42
My logic with this was to follow the whole "fronte
|
+#include "content/common/notification_observer.h" |
+#include "content/common/notification_registrar.h" |
-class Profile; |
-class ProfileSyncFactory; |
-class ProfileSyncService; |
+class NotificationDetails; |
+class NotificationType; |
+class NotificationSource; |
namespace browser_sync { |
-class AssociatorInterface; |
-class ChangeProcessor; |
- |
// A class that manages the startup and shutdown of autofill sync. |
-class AutofillDataTypeController : public DataTypeController, |
+class AutofillDataTypeController : public NonFrontendDataTypeController, |
public NotificationObserver, |
public PersonalDataManager::Observer { |
public: |
@@ -36,25 +31,10 @@ class AutofillDataTypeController : public DataTypeController, |
ProfileSyncService* sync_service); |
virtual ~AutofillDataTypeController(); |
- // DataTypeController implementation |
- virtual void Start(StartCallback* start_callback); |
- |
- virtual void Stop(); |
- |
- virtual bool enabled(); |
- |
+ // NonFrontendDataTypeController implementation |
virtual syncable::ModelType type() const; |
- |
virtual browser_sync::ModelSafeGroup model_safe_group() const; |
- virtual std::string name() const; |
- |
- virtual State state() const; |
- |
- // UnrecoverableHandler implementation |
- virtual void OnUnrecoverableError(const tracked_objects::Location& from_here, |
- const std::string& message); |
- |
// NotificationObserver implementation. |
virtual void Observe(NotificationType type, |
const NotificationSource& source, |
@@ -64,52 +44,22 @@ class AutofillDataTypeController : public DataTypeController, |
virtual void OnPersonalDataLoaded(); |
protected: |
- virtual ProfileSyncFactory::SyncComponents CreateSyncComponents( |
- ProfileSyncService* profile_sync_service, |
- WebDatabase* web_database, |
- PersonalDataManager* personal_data, |
- browser_sync::UnrecoverableErrorHandler* error_handler); |
- ProfileSyncFactory* profile_sync_factory_; |
- |
- private: |
- void StartImpl(); |
- void StartDone(StartResult result, State state); |
- void StartDoneImpl(StartResult result, State state, |
- const tracked_objects::Location& location); |
- void StopImpl(); |
- void StartFailed(StartResult result); |
- void OnUnrecoverableErrorImpl(const tracked_objects::Location& from_here, |
- const std::string& message); |
- |
- // Second-half of "Start" implementation, called once personal data has |
- // loaded. |
- void ContinueStartAfterPersonalDataLoaded(); |
- |
- void set_state(State state) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- state_ = state; |
- } |
- |
- Profile* profile_; |
- ProfileSyncService* sync_service_; |
- State state_; |
+ // NonFrontendDataTypeController interface. |
+ virtual bool StartModels(); |
+ virtual bool KickOffAssociation(); |
+ virtual void CreateSyncComponents(); |
+ virtual void CleanUpState(); |
+ virtual bool KickOffDestroy(); |
+ virtual void RecordUnrecoverableError( |
+ const tracked_objects::Location& from_here, |
+ const std::string& message); |
+ virtual void RecordAssociationTime(base::TimeDelta time); |
+ virtual void RecordStartFailure(StartResult result); |
PersonalDataManager* personal_data_; |
scoped_refptr<WebDataService> web_data_service_; |
- scoped_ptr<AssociatorInterface> model_associator_; |
- scoped_ptr<ChangeProcessor> change_processor_; |
- scoped_ptr<StartCallback> start_callback_; |
- |
NotificationRegistrar notification_registrar_; |
- base::Lock abort_association_lock_; |
- bool abort_association_; |
- base::WaitableEvent abort_association_complete_; |
- |
- // Barrier to ensure that the datatype has been stopped on the DB thread |
- // from the UI thread. |
- base::WaitableEvent datatype_stopped_; |
- |
DISALLOW_COPY_AND_ASSIGN(AutofillDataTypeController); |
}; |