OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 CancelationSignal* cancelation_signal; | 271 CancelationSignal* cancelation_signal; |
272 | 272 |
273 // Optional nigori state to be restored. | 273 // Optional nigori state to be restored. |
274 scoped_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state; | 274 scoped_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state; |
275 | 275 |
276 // Whether sync should clear server data when transitioning to passphrase | 276 // Whether sync should clear server data when transitioning to passphrase |
277 // encryption. | 277 // encryption. |
278 PassphraseTransitionClearDataOption clear_data_option; | 278 PassphraseTransitionClearDataOption clear_data_option; |
279 }; | 279 }; |
280 | 280 |
| 281 typedef base::Callback<void(void)> ClearServerDataCallback; |
| 282 |
281 SyncManager(); | 283 SyncManager(); |
282 virtual ~SyncManager(); | 284 virtual ~SyncManager(); |
283 | 285 |
284 // Initialize the sync manager using arguments from |args|. | 286 // Initialize the sync manager using arguments from |args|. |
285 // | 287 // |
286 // Note, args is passed by non-const pointer because it contains objects like | 288 // Note, args is passed by non-const pointer because it contains objects like |
287 // scoped_ptr. | 289 // scoped_ptr. |
288 virtual void Init(InitArgs* args) = 0; | 290 virtual void Init(InitArgs* args) = 0; |
289 | 291 |
290 virtual ModelTypeSet InitialSyncEndedTypes() = 0; | 292 virtual ModelTypeSet InitialSyncEndedTypes() = 0; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 virtual void RegisterDirectoryTypeDebugInfoObserver( | 395 virtual void RegisterDirectoryTypeDebugInfoObserver( |
394 syncer::TypeDebugInfoObserver* observer) = 0; | 396 syncer::TypeDebugInfoObserver* observer) = 0; |
395 virtual void UnregisterDirectoryTypeDebugInfoObserver( | 397 virtual void UnregisterDirectoryTypeDebugInfoObserver( |
396 syncer::TypeDebugInfoObserver* observer) = 0; | 398 syncer::TypeDebugInfoObserver* observer) = 0; |
397 virtual bool HasDirectoryTypeDebugInfoObserver( | 399 virtual bool HasDirectoryTypeDebugInfoObserver( |
398 syncer::TypeDebugInfoObserver* observer) = 0; | 400 syncer::TypeDebugInfoObserver* observer) = 0; |
399 | 401 |
400 // Request that all current counter values be emitted as though they had just | 402 // Request that all current counter values be emitted as though they had just |
401 // been updated. Useful for initializing new observers' state. | 403 // been updated. Useful for initializing new observers' state. |
402 virtual void RequestEmitDebugInfo() = 0; | 404 virtual void RequestEmitDebugInfo() = 0; |
| 405 |
| 406 // Clears server data and invokes |callback| when complete. |
| 407 // |
| 408 // This is an asynchronous operation that requires interaction with the sync |
| 409 // server. The operation will automatically be retried with backoff until it |
| 410 // completes successfully or sync is shutdown. |
| 411 virtual void ClearServerData(const ClearServerDataCallback& callback) = 0; |
403 }; | 412 }; |
404 | 413 |
405 } // namespace syncer | 414 } // namespace syncer |
406 | 415 |
407 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 416 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
OLD | NEW |