| 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 SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 332 |
| 333 // Purge from the directory those types with non-empty progress markers | 333 // Purge from the directory those types with non-empty progress markers |
| 334 // but without initial synced ended set. | 334 // but without initial synced ended set. |
| 335 // Returns false if an error occurred, true otherwise. | 335 // Returns false if an error occurred, true otherwise. |
| 336 virtual bool PurgePartiallySyncedTypes() = 0; | 336 virtual bool PurgePartiallySyncedTypes() = 0; |
| 337 | 337 |
| 338 // Update tokens that we're using in Sync. Email must stay the same. | 338 // Update tokens that we're using in Sync. Email must stay the same. |
| 339 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0; | 339 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0; |
| 340 | 340 |
| 341 // Called when the user disables or enables a sync type. | 341 // Called when the user disables or enables a sync type. |
| 342 virtual void UpdateEnabledTypes( | 342 virtual void UpdateEnabledTypes(ModelTypeSet enabled_types) = 0; |
| 343 const ModelTypeSet& enabled_types) = 0; | |
| 344 | 343 |
| 345 // Forwards to the underlying invalidator (see comments in invalidator.h). | 344 // Forwards to the underlying invalidator (see comments in invalidator.h). |
| 346 virtual void RegisterInvalidationHandler( | 345 virtual void RegisterInvalidationHandler( |
| 347 InvalidationHandler* handler) = 0; | 346 InvalidationHandler* handler) = 0; |
| 348 | 347 |
| 349 // Forwards to the underlying notifier (see comments in invalidator.h). | 348 // Forwards to the underlying notifier (see comments in invalidator.h). |
| 350 virtual void UpdateRegisteredInvalidationIds( | 349 virtual void UpdateRegisteredInvalidationIds( |
| 351 InvalidationHandler* handler, | 350 InvalidationHandler* handler, |
| 352 const ObjectIdSet& ids) = 0; | 351 const ObjectIdSet& ids) = 0; |
| 353 | 352 |
| 354 // Forwards to the underlying notifier (see comments in invalidator.h). | 353 // Forwards to the underlying notifier (see comments in invalidator.h). |
| 355 virtual void UnregisterInvalidationHandler( | 354 virtual void UnregisterInvalidationHandler( |
| 356 InvalidationHandler* handler) = 0; | 355 InvalidationHandler* handler) = 0; |
| 357 | 356 |
| 358 // Put the syncer in normal mode ready to perform nudges and polls. | 357 // Put the syncer in normal mode ready to perform nudges and polls. |
| 359 virtual void StartSyncingNormally( | 358 virtual void StartSyncingNormally( |
| 360 const ModelSafeRoutingInfo& routing_info) = 0; | 359 const ModelSafeRoutingInfo& routing_info) = 0; |
| 361 | 360 |
| 362 // Switches the mode of operation to CONFIGURATION_MODE and performs | 361 // Switches the mode of operation to CONFIGURATION_MODE and performs |
| 363 // any configuration tasks needed as determined by the params. Once complete, | 362 // any configuration tasks needed as determined by the params. Once complete, |
| 364 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is | 363 // syncer will remain in CONFIGURATION_MODE until StartSyncingNormally is |
| 365 // called. | 364 // called. |
| 366 // |ready_task| is invoked when the configuration completes. | 365 // |ready_task| is invoked when the configuration completes. |
| 367 // |retry_task| is invoked if the configuration job could not immediately | 366 // |retry_task| is invoked if the configuration job could not immediately |
| 368 // execute. |ready_task| will still be called when it eventually | 367 // execute. |ready_task| will still be called when it eventually |
| 369 // does finish. | 368 // does finish. |
| 370 virtual void ConfigureSyncer( | 369 virtual void ConfigureSyncer( |
| 371 ConfigureReason reason, | 370 ConfigureReason reason, |
| 372 const ModelTypeSet& types_to_config, | 371 ModelTypeSet types_to_config, |
| 373 const ModelSafeRoutingInfo& new_routing_info, | 372 const ModelSafeRoutingInfo& new_routing_info, |
| 374 const base::Closure& ready_task, | 373 const base::Closure& ready_task, |
| 375 const base::Closure& retry_task) = 0; | 374 const base::Closure& retry_task) = 0; |
| 376 | 375 |
| 377 // Adds a listener to be notified of sync events. | 376 // Adds a listener to be notified of sync events. |
| 378 // NOTE: It is OK (in fact, it's probably a good idea) to call this before | 377 // NOTE: It is OK (in fact, it's probably a good idea) to call this before |
| 379 // having received OnInitializationCompleted. | 378 // having received OnInitializationCompleted. |
| 380 virtual void AddObserver(Observer* observer) = 0; | 379 virtual void AddObserver(Observer* observer) = 0; |
| 381 | 380 |
| 382 // Remove the given observer. Make sure to call this if the | 381 // Remove the given observer. Make sure to call this if the |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // any remaining unsynced items. May be called on any thread. | 416 // any remaining unsynced items. May be called on any thread. |
| 418 virtual bool HasUnsyncedItems() = 0; | 417 virtual bool HasUnsyncedItems() = 0; |
| 419 | 418 |
| 420 // Returns the SyncManager's encryption handler. | 419 // Returns the SyncManager's encryption handler. |
| 421 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; | 420 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; |
| 422 }; | 421 }; |
| 423 | 422 |
| 424 } // namespace syncer | 423 } // namespace syncer |
| 425 | 424 |
| 426 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 425 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| OLD | NEW |