| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/task_runner.h" | 15 #include "base/task_runner.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "sync/internal_api/public/base/model_type.h" | 18 #include "sync/internal_api/public/base/model_type.h" |
| 19 #include "sync/internal_api/public/change_record.h" | 19 #include "sync/internal_api/public/change_record.h" |
| 20 #include "sync/internal_api/public/configure_reason.h" | 20 #include "sync/internal_api/public/configure_reason.h" |
| 21 #include "sync/internal_api/public/engine/model_safe_worker.h" | 21 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 22 #include "sync/internal_api/public/engine/sync_status.h" | 22 #include "sync/internal_api/public/engine/sync_status.h" |
| 23 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" | 23 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" |
| 24 #include "sync/internal_api/public/util/weak_handle.h" | 24 #include "sync/internal_api/public/util/weak_handle.h" |
| 25 #include "sync/notifier/invalidation_util.h" |
| 25 #include "sync/protocol/sync_protocol_error.h" | 26 #include "sync/protocol/sync_protocol_error.h" |
| 26 | 27 |
| 27 namespace syncer { | |
| 28 class Encryptor; | |
| 29 struct Experiments; | |
| 30 class ExtensionsActivityMonitor; | |
| 31 class InternalComponentsFactory; | |
| 32 class JsBackend; | |
| 33 class JsEventHandler; | |
| 34 class SyncScheduler; | |
| 35 class UnrecoverableErrorHandler; | |
| 36 | |
| 37 namespace sessions { | |
| 38 class SyncSessionSnapshot; | |
| 39 } // namespace sessions | |
| 40 } // namespace syncer | |
| 41 | |
| 42 namespace syncer { | |
| 43 class SyncNotifier; | |
| 44 } // namespace syncer | |
| 45 | |
| 46 namespace sync_pb { | 28 namespace sync_pb { |
| 47 class EncryptedData; | 29 class EncryptedData; |
| 48 } // namespace sync_pb | 30 } // namespace sync_pb |
| 49 | 31 |
| 50 namespace syncer { | 32 namespace syncer { |
| 33 class BaseTransaction; |
| 34 class Encryptor; |
| 35 struct Experiments; |
| 36 class ExtensionsActivityMonitor; |
| 37 class HttpPostProviderFactory; |
| 38 class InternalComponentsFactory; |
| 39 class JsBackend; |
| 40 class JsEventHandler; |
| 41 class SyncNotifier; |
| 42 class SyncNotifierObserver; |
| 43 class SyncScheduler; |
| 44 class UnrecoverableErrorHandler; |
| 45 struct UserShare; |
| 51 | 46 |
| 52 class BaseTransaction; | 47 namespace sessions { |
| 53 class HttpPostProviderFactory; | 48 class SyncSessionSnapshot; |
| 54 struct UserShare; | 49 } // namespace sessions |
| 55 | 50 |
| 56 // Used by SyncManager::OnConnectionStatusChange(). | 51 // Used by SyncManager::OnConnectionStatusChange(). |
| 57 enum ConnectionStatus { | 52 enum ConnectionStatus { |
| 58 CONNECTION_OK, | 53 CONNECTION_OK, |
| 59 CONNECTION_AUTH_ERROR, | 54 CONNECTION_AUTH_ERROR, |
| 60 CONNECTION_SERVER_ERROR | 55 CONNECTION_SERVER_ERROR |
| 61 }; | 56 }; |
| 62 | 57 |
| 63 // Reasons due to which Cryptographer might require a passphrase. | 58 // Reasons due to which Cryptographer might require a passphrase. |
| 64 enum PassphraseRequiredReason { | 59 enum PassphraseRequiredReason { |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 // Returns false if an error occurred, true otherwise. | 393 // Returns false if an error occurred, true otherwise. |
| 399 virtual bool PurgePartiallySyncedTypes() = 0; | 394 virtual bool PurgePartiallySyncedTypes() = 0; |
| 400 | 395 |
| 401 // Update tokens that we're using in Sync. Email must stay the same. | 396 // Update tokens that we're using in Sync. Email must stay the same. |
| 402 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0; | 397 virtual void UpdateCredentials(const SyncCredentials& credentials) = 0; |
| 403 | 398 |
| 404 // Called when the user disables or enables a sync type. | 399 // Called when the user disables or enables a sync type. |
| 405 virtual void UpdateEnabledTypes( | 400 virtual void UpdateEnabledTypes( |
| 406 const ModelTypeSet& enabled_types) = 0; | 401 const ModelTypeSet& enabled_types) = 0; |
| 407 | 402 |
| 403 // Forwards to the underlying notifier (see |
| 404 // SyncNotifier::UpdateRegisteredIds()). |
| 405 virtual void UpdateRegisteredIds( |
| 406 SyncNotifierObserver* handler, const ObjectIdSet& ids) = 0; |
| 407 |
| 408 // Put the syncer in normal mode ready to perform nudges and polls. | 408 // Put the syncer in normal mode ready to perform nudges and polls. |
| 409 virtual void StartSyncingNormally( | 409 virtual void StartSyncingNormally( |
| 410 const ModelSafeRoutingInfo& routing_info) = 0; | 410 const ModelSafeRoutingInfo& routing_info) = 0; |
| 411 | 411 |
| 412 // Attempts to re-encrypt encrypted data types using the passphrase provided. | 412 // Attempts to re-encrypt encrypted data types using the passphrase provided. |
| 413 // Notifies observers of the result of the operation via OnPassphraseAccepted | 413 // Notifies observers of the result of the operation via OnPassphraseAccepted |
| 414 // or OnPassphraseRequired, updates the nigori node, and does re-encryption as | 414 // or OnPassphraseRequired, updates the nigori node, and does re-encryption as |
| 415 // appropriate. If an explicit password has been set previously, we drop | 415 // appropriate. If an explicit password has been set previously, we drop |
| 416 // subsequent requests to set a passphrase. If the cryptographer has pending | 416 // subsequent requests to set a passphrase. If the cryptographer has pending |
| 417 // keys, and a new implicit passphrase is provided, we try decrypting the | 417 // keys, and a new implicit passphrase is provided, we try decrypting the |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 virtual bool ReceivedExperiment(Experiments* experiments) = 0; | 510 virtual bool ReceivedExperiment(Experiments* experiments) = 0; |
| 511 | 511 |
| 512 // Uses a read-only transaction to determine if the directory being synced has | 512 // Uses a read-only transaction to determine if the directory being synced has |
| 513 // any remaining unsynced items. May be called on any thread. | 513 // any remaining unsynced items. May be called on any thread. |
| 514 virtual bool HasUnsyncedItems() = 0; | 514 virtual bool HasUnsyncedItems() = 0; |
| 515 }; | 515 }; |
| 516 | 516 |
| 517 } // namespace syncer | 517 } // namespace syncer |
| 518 | 518 |
| 519 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 519 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
| OLD | NEW |