| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_SYNC_DRIVER_BACKEND_MIGRATOR_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_BACKEND_MIGRATOR_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_BACKEND_MIGRATOR_H_ | 6 #define COMPONENTS_SYNC_DRIVER_BACKEND_MIGRATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Starts a sequence of events that will disable and reenable |types|. | 60 // Starts a sequence of events that will disable and reenable |types|. |
| 61 void MigrateTypes(syncer::ModelTypeSet types); | 61 void MigrateTypes(syncer::ModelTypeSet types); |
| 62 | 62 |
| 63 void AddMigrationObserver(MigrationObserver* observer); | 63 void AddMigrationObserver(MigrationObserver* observer); |
| 64 bool HasMigrationObserver(const MigrationObserver* observer) const; | 64 bool HasMigrationObserver(const MigrationObserver* observer) const; |
| 65 void RemoveMigrationObserver(MigrationObserver* observer); | 65 void RemoveMigrationObserver(MigrationObserver* observer); |
| 66 | 66 |
| 67 State state() const; | 67 State state() const; |
| 68 | 68 |
| 69 // Called from ProfileSyncService to notify us of configure done. | 69 // Called from ProfileSyncService to notify us of configure done. |
| 70 // Note: We receive these notificiations only when our state is not IDLE. | 70 // Note: We receive these notifications only when our state is not IDLE. |
| 71 void OnConfigureDone( | 71 void OnConfigureDone( |
| 72 const sync_driver::DataTypeManager::ConfigureResult& result); | 72 const sync_driver::DataTypeManager::ConfigureResult& result); |
| 73 | 73 |
| 74 // Returns the types that are currently pending migration (if any). | 74 // Returns the types that are currently pending migration (if any). |
| 75 syncer::ModelTypeSet GetPendingMigrationTypesForTest() const; | 75 syncer::ModelTypeSet GetPendingMigrationTypesForTest() const; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 void ChangeState(State new_state); | 78 void ChangeState(State new_state); |
| 79 | 79 |
| 80 // Must be called only in state WAITING_TO_START. If ready to | 80 // Must be called only in state WAITING_TO_START. If ready to |
| (...skipping 23 matching lines...) Expand all Loading... |
| 104 base::Closure migration_done_callback_; | 104 base::Closure migration_done_callback_; |
| 105 | 105 |
| 106 base::WeakPtrFactory<BackendMigrator> weak_ptr_factory_; | 106 base::WeakPtrFactory<BackendMigrator> weak_ptr_factory_; |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(BackendMigrator); | 108 DISALLOW_COPY_AND_ASSIGN(BackendMigrator); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace browser_sync | 111 } // namespace browser_sync |
| 112 | 112 |
| 113 #endif // COMPONENTS_SYNC_DRIVER_BACKEND_MIGRATOR_H_ | 113 #endif // COMPONENTS_SYNC_DRIVER_BACKEND_MIGRATOR_H_ |
| OLD | NEW |