| 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 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // |ModelAssociationManager| does the heavy lifting for doing the actual model | 22 // |ModelAssociationManager| does the heavy lifting for doing the actual model |
| 23 // association. It instructs DataTypeControllers to load models, start | 23 // association. It instructs DataTypeControllers to load models, start |
| 24 // associating and stopping. Since the operations are async it uses an | 24 // associating and stopping. Since the operations are async it uses an |
| 25 // interface to inform DataTypeManager the results of the operations. | 25 // interface to inform DataTypeManager the results of the operations. |
| 26 // This class is owned by DataTypeManager. | 26 // This class is owned by DataTypeManager. |
| 27 // |ModelAssociationManager| association functions are async. The results of | 27 // |ModelAssociationManager| association functions are async. The results of |
| 28 // those operations are passed back via this interface. | 28 // those operations are passed back via this interface. |
| 29 class ModelAssociationManagerDelegate { | 29 class ModelAssociationManagerDelegate { |
| 30 public: | 30 public: |
| 31 // Called right before ModelAssociationManager calls LoadModels. Allows |
| 32 // directory types to register with sync engine before download starts. |
| 33 virtual void OnSingleDataTypeWillStart(ModelType type) = 0; |
| 34 |
| 31 // Called when all desired types are ready to be configured with | 35 // Called when all desired types are ready to be configured with |
| 32 // ModelTypeConfigurer. Data type is ready when its progress marker is | 36 // ModelTypeConfigurer. Data type is ready when its progress marker is |
| 33 // available to configurer. Directory data types are always ready, their | 37 // available to configurer. Directory data types are always ready, their |
| 34 // progress markers are read from directory. USS data type controllers need to | 38 // progress markers are read from directory. USS data type controllers need to |
| 35 // load model and read data type context first. | 39 // load model and read data type context first. |
| 36 // This function is called at most once after each call to | 40 // This function is called at most once after each call to |
| 37 // ModelAssociationManager::Initialize(). | 41 // ModelAssociationManager::Initialize(). |
| 38 virtual void OnAllDataTypesReadyForConfigure() = 0; | 42 virtual void OnAllDataTypesReadyForConfigure() = 0; |
| 39 | 43 |
| 40 // Called when model association (MergeDataAndStartSyncing) has completed | 44 // Called when model association (MergeDataAndStartSyncing) has completed |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 bool notified_about_ready_for_configure_; | 177 bool notified_about_ready_for_configure_; |
| 174 | 178 |
| 175 base::WeakPtrFactory<ModelAssociationManager> weak_ptr_factory_; | 179 base::WeakPtrFactory<ModelAssociationManager> weak_ptr_factory_; |
| 176 | 180 |
| 177 DISALLOW_COPY_AND_ASSIGN(ModelAssociationManager); | 181 DISALLOW_COPY_AND_ASSIGN(ModelAssociationManager); |
| 178 }; | 182 }; |
| 179 | 183 |
| 180 } // namespace syncer | 184 } // namespace syncer |
| 181 | 185 |
| 182 #endif // COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATION_MANAGER_H__ | 186 #endif // COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATION_MANAGER_H__ |
| OLD | NEW |