| Index: chrome/browser/sync/backend_migrator.h
|
| diff --git a/chrome/browser/sync/backend_migrator.h b/chrome/browser/sync/backend_migrator.h
|
| index 4688ce63d72dddb65f35826f8aade9170b16981f..d40ddbb16f883810de6a36e8b66f0f92a30abfcd 100644
|
| --- a/chrome/browser/sync/backend_migrator.h
|
| +++ b/chrome/browser/sync/backend_migrator.h
|
| @@ -33,7 +33,7 @@ class MigrationObserver {
|
|
|
| // A class to perform migration of a datatype pursuant to the 'MIGRATION_DONE'
|
| // code in the sync protocol definition (protocol/sync.proto).
|
| -class BackendMigrator : public content::NotificationObserver {
|
| +class BackendMigrator {
|
| public:
|
| enum State {
|
| IDLE,
|
| @@ -50,7 +50,8 @@ class BackendMigrator : public content::NotificationObserver {
|
| BackendMigrator(const std::string& name,
|
| sync_api::UserShare* user_share,
|
| ProfileSyncService* service,
|
| - DataTypeManager* manager);
|
| + DataTypeManager* manager,
|
| + const base::Closure &migration_done_callback);
|
| virtual ~BackendMigrator();
|
|
|
| // Starts a sequence of events that will disable and reenable |types|.
|
| @@ -60,13 +61,12 @@ class BackendMigrator : public content::NotificationObserver {
|
| bool HasMigrationObserver(MigrationObserver* observer) const;
|
| void RemoveMigrationObserver(MigrationObserver* observer);
|
|
|
| - // content::NotificationObserver implementation.
|
| - virtual void Observe(int type,
|
| - const content::NotificationSource& source,
|
| - const content::NotificationDetails& details) OVERRIDE;
|
| -
|
| State state() const;
|
|
|
| + // Called from ProfileSyncService to notify us of configure done.
|
| + // Note: We receive these notificiations only when our state is not IDLE.
|
| + void OnConfigureDone(const DataTypeManager::ConfigureResult& result);
|
| +
|
| // Returns the types that are currently pending migration (if any).
|
| syncable::ModelTypeSet GetPendingMigrationTypesForTest() const;
|
|
|
| @@ -82,8 +82,8 @@ class BackendMigrator : public content::NotificationObserver {
|
| // Restarts migration, interrupting any existing migration.
|
| void RestartMigration();
|
|
|
| - // Called by Observe().
|
| - void OnConfigureDone(const DataTypeManager::ConfigureResult& result);
|
| + // Called by OnConfigureDone().
|
| + void OnConfigureDoneImpl(const DataTypeManager::ConfigureResult& result);
|
|
|
| const std::string name_;
|
| sync_api::UserShare* user_share_;
|
| @@ -92,14 +92,14 @@ class BackendMigrator : public content::NotificationObserver {
|
|
|
| State state_;
|
|
|
| - content::NotificationRegistrar registrar_;
|
| -
|
| ObserverList<MigrationObserver> migration_observers_;
|
|
|
| syncable::ModelTypeSet to_migrate_;
|
|
|
| base::WeakPtrFactory<BackendMigrator> weak_ptr_factory_;
|
|
|
| + base::Closure migration_done_callback_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(BackendMigrator);
|
| };
|
|
|
|
|