| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MODEL_ASSOCIATION_MANAGER_H__ | 5 #ifndef COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATION_MANAGER_H__ |
| 6 #define COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATION_MANAGER_H__ | 6 #define COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATION_MANAGER_H__ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // Callback passed to each data type controller on starting association. This | 112 // Callback passed to each data type controller on starting association. This |
| 113 // callback will be invoked when the model association is done. | 113 // callback will be invoked when the model association is done. |
| 114 void TypeStartCallback(syncer::ModelType type, | 114 void TypeStartCallback(syncer::ModelType type, |
| 115 base::TimeTicks type_start_time, | 115 base::TimeTicks type_start_time, |
| 116 DataTypeController::ConfigureResult start_result, | 116 DataTypeController::ConfigureResult start_result, |
| 117 const syncer::SyncMergeResult& local_merge_result, | 117 const syncer::SyncMergeResult& local_merge_result, |
| 118 const syncer::SyncMergeResult& syncer_merge_result); | 118 const syncer::SyncMergeResult& syncer_merge_result); |
| 119 | 119 |
| 120 // Callback that will be invoked when the models finish loading. This callback | 120 // Callback that will be invoked when the models finish loading. This callback |
| 121 // will be passed to |LoadModels| function. | 121 // will be passed to |LoadModels| function. |
| 122 void ModelLoadCallback(syncer::ModelType type, syncer::SyncError error); | 122 void ModelLoadCallback(syncer::ModelType type, |
| 123 const syncer::SyncError& error); |
| 123 | 124 |
| 124 // Called when all requested types are associated or association times out. | 125 // Called when all requested types are associated or association times out. |
| 125 // Will clean up any unfinished types, and update |state_| to be |new_state| | 126 // Will clean up any unfinished types, and update |state_| to be |new_state| |
| 126 // Finally, it will notify |delegate_| of the configuration result. | 127 // Finally, it will notify |delegate_| of the configuration result. |
| 127 void ModelAssociationDone(State new_state); | 128 void ModelAssociationDone(State new_state); |
| 128 | 129 |
| 129 // A helper to stop an individual datatype. | 130 // A helper to stop an individual datatype. |
| 130 void StopDatatype(const syncer::SyncError& error, DataTypeController* dtc); | 131 void StopDatatype(const syncer::SyncError& error, DataTypeController* dtc); |
| 131 | 132 |
| 132 // Calls delegate's OnAllDataTypesReadyForConfigure when all datatypes from | 133 // Calls delegate's OnAllDataTypesReadyForConfigure when all datatypes from |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 bool notified_about_ready_for_configure_; | 174 bool notified_about_ready_for_configure_; |
| 174 | 175 |
| 175 base::WeakPtrFactory<ModelAssociationManager> weak_ptr_factory_; | 176 base::WeakPtrFactory<ModelAssociationManager> weak_ptr_factory_; |
| 176 | 177 |
| 177 DISALLOW_COPY_AND_ASSIGN(ModelAssociationManager); | 178 DISALLOW_COPY_AND_ASSIGN(ModelAssociationManager); |
| 178 }; | 179 }; |
| 179 | 180 |
| 180 } // namespace sync_driver | 181 } // namespace sync_driver |
| 181 | 182 |
| 182 #endif // COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATION_MANAGER_H__ | 183 #endif // COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATION_MANAGER_H__ |
| OLD | NEW |