| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_BACKEND_MIGRATOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_BACKEND_MIGRATOR_H_ |
| 6 #define CHROME_BROWSER_SYNC_BACKEND_MIGRATOR_H_ | 6 #define CHROME_BROWSER_SYNC_BACKEND_MIGRATOR_H_ |
| 7 | 7 |
| 8 #include "base/task.h" | 8 #include "base/task.h" |
| 9 #include "chrome/browser/sync/profile_sync_service_observer.h" | 9 #include "chrome/browser/sync/profile_sync_service_observer.h" |
| 10 #include "chrome/browser/sync/syncable/model_type.h" | 10 #include "chrome/browser/sync/syncable/model_type.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 BackendMigrator(ProfileSyncService* service, DataTypeManager* manager); | 36 BackendMigrator(ProfileSyncService* service, DataTypeManager* manager); |
| 37 virtual ~BackendMigrator(); | 37 virtual ~BackendMigrator(); |
| 38 | 38 |
| 39 // Starts a sequence of events that will disable and reenable |types|. | 39 // Starts a sequence of events that will disable and reenable |types|. |
| 40 void MigrateTypes(const syncable::ModelTypeSet& types); | 40 void MigrateTypes(const syncable::ModelTypeSet& types); |
| 41 | 41 |
| 42 // ProfileSyncServiceObserver implementation. | 42 // ProfileSyncServiceObserver implementation. |
| 43 virtual void OnStateChanged(); | 43 virtual void OnStateChanged(); |
| 44 | 44 |
| 45 // NotificationObserver implementation. | 45 // NotificationObserver implementation. |
| 46 virtual void Observe(NotificationType type, | 46 virtual void Observe(int type, |
| 47 const NotificationSource& source, | 47 const NotificationSource& source, |
| 48 const NotificationDetails& details); | 48 const NotificationDetails& details); |
| 49 | 49 |
| 50 State state() const; | 50 State state() const; |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 bool HasStartedMigrating() const; | 53 bool HasStartedMigrating() const; |
| 54 | 54 |
| 55 State state_; | 55 State state_; |
| 56 ProfileSyncService* service_; | 56 ProfileSyncService* service_; |
| 57 DataTypeManager* manager_; | 57 DataTypeManager* manager_; |
| 58 NotificationRegistrar registrar_; | 58 NotificationRegistrar registrar_; |
| 59 | 59 |
| 60 syncable::ModelTypeSet to_migrate_; | 60 syncable::ModelTypeSet to_migrate_; |
| 61 bool restart_migration_; | 61 bool restart_migration_; |
| 62 | 62 |
| 63 // We use this to gracefully re-start migrations. | 63 // We use this to gracefully re-start migrations. |
| 64 ScopedRunnableMethodFactory<BackendMigrator> method_factory_; | 64 ScopedRunnableMethodFactory<BackendMigrator> method_factory_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(BackendMigrator); | 66 DISALLOW_COPY_AND_ASSIGN(BackendMigrator); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace browser_sync | 69 } // namespace browser_sync |
| 70 | 70 |
| 71 #endif // CHROME_BROWSER_SYNC_BACKEND_MIGRATOR_H_ | 71 #endif // CHROME_BROWSER_SYNC_BACKEND_MIGRATOR_H_ |
| OLD | NEW |