| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 virtual void OnInitializationComplete( | 302 virtual void OnInitializationComplete( |
| 303 const browser_sync::WeakHandle<browser_sync::JsBackend>& | 303 const browser_sync::WeakHandle<browser_sync::JsBackend>& |
| 304 js_backend, bool success) = 0; | 304 js_backend, bool success) = 0; |
| 305 | 305 |
| 306 // We are no longer permitted to communicate with the server. Sync should | 306 // We are no longer permitted to communicate with the server. Sync should |
| 307 // be disabled and state cleaned up at once. This can happen for a number | 307 // be disabled and state cleaned up at once. This can happen for a number |
| 308 // of reasons, e.g. swapping from a test instance to production, or a | 308 // of reasons, e.g. swapping from a test instance to production, or a |
| 309 // global stop syncing operation has wiped the store. | 309 // global stop syncing operation has wiped the store. |
| 310 virtual void OnStopSyncingPermanently() = 0; | 310 virtual void OnStopSyncingPermanently() = 0; |
| 311 | 311 |
| 312 // After a request to clear server data, these callbacks are invoked to | |
| 313 // indicate success or failure. | |
| 314 virtual void OnClearServerDataSucceeded() = 0; | |
| 315 virtual void OnClearServerDataFailed() = 0; | |
| 316 | |
| 317 // Called when the set of encrypted types or the encrypt | 312 // Called when the set of encrypted types or the encrypt |
| 318 // everything flag has been changed. Note that encryption isn't | 313 // everything flag has been changed. Note that encryption isn't |
| 319 // complete until the OnEncryptionComplete() notification has been | 314 // complete until the OnEncryptionComplete() notification has been |
| 320 // sent (see below). | 315 // sent (see below). |
| 321 // | 316 // |
| 322 // |encrypted_types| will always be a superset of | 317 // |encrypted_types| will always be a superset of |
| 323 // Cryptographer::SensitiveTypes(). If |encrypt_everything| is | 318 // Cryptographer::SensitiveTypes(). If |encrypt_everything| is |
| 324 // true, |encrypted_types| will be the set of all known types. | 319 // true, |encrypted_types| will be the set of all known types. |
| 325 // | 320 // |
| 326 // Until this function is called, observers can assume that the | 321 // Until this function is called, observers can assume that the |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 434 |
| 440 // Switches the mode of operation to CONFIGURATION_MODE and | 435 // Switches the mode of operation to CONFIGURATION_MODE and |
| 441 // schedules a config task to fetch updates for |types|. | 436 // schedules a config task to fetch updates for |types|. |
| 442 void RequestConfig(const browser_sync::ModelSafeRoutingInfo& routing_info, | 437 void RequestConfig(const browser_sync::ModelSafeRoutingInfo& routing_info, |
| 443 const syncable::ModelTypeSet& types, | 438 const syncable::ModelTypeSet& types, |
| 444 sync_api::ConfigureReason reason); | 439 sync_api::ConfigureReason reason); |
| 445 | 440 |
| 446 void RequestCleanupDisabledTypes( | 441 void RequestCleanupDisabledTypes( |
| 447 const browser_sync::ModelSafeRoutingInfo& routing_info); | 442 const browser_sync::ModelSafeRoutingInfo& routing_info); |
| 448 | 443 |
| 449 // Request a clearing of all data on the server | |
| 450 void RequestClearServerData(); | |
| 451 | |
| 452 // Adds a listener to be notified of sync events. | 444 // Adds a listener to be notified of sync events. |
| 453 // NOTE: It is OK (in fact, it's probably a good idea) to call this before | 445 // NOTE: It is OK (in fact, it's probably a good idea) to call this before |
| 454 // having received OnInitializationCompleted. | 446 // having received OnInitializationCompleted. |
| 455 void AddObserver(Observer* observer); | 447 void AddObserver(Observer* observer); |
| 456 | 448 |
| 457 // Remove the given observer. Make sure to call this if the | 449 // Remove the given observer. Make sure to call this if the |
| 458 // Observer is being destroyed so the SyncManager doesn't | 450 // Observer is being destroyed so the SyncManager doesn't |
| 459 // potentially dereference garbage. | 451 // potentially dereference garbage. |
| 460 void RemoveObserver(Observer* observer); | 452 void RemoveObserver(Observer* observer); |
| 461 | 453 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 sync_api::UserShare* share); | 556 sync_api::UserShare* share); |
| 565 | 557 |
| 566 const char* ConnectionStatusToString(ConnectionStatus status); | 558 const char* ConnectionStatusToString(ConnectionStatus status); |
| 567 | 559 |
| 568 // Returns the string representation of a PassphraseRequiredReason value. | 560 // Returns the string representation of a PassphraseRequiredReason value. |
| 569 const char* PassphraseRequiredReasonToString(PassphraseRequiredReason reason); | 561 const char* PassphraseRequiredReasonToString(PassphraseRequiredReason reason); |
| 570 | 562 |
| 571 } // namespace sync_api | 563 } // namespace sync_api |
| 572 | 564 |
| 573 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 565 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| OLD | NEW |