| 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_TEST_FAKE_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "sync/internal_api/public/sync_manager.h" | 12 #include "sync/internal_api/public/sync_manager.h" |
| 13 #include "sync/notifier/sync_notifier_registrar.h" | 13 #include "sync/notifier/sync_notifier_registrar.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class SequencedTaskRunner; | 16 class SequencedTaskRunner; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace syncer { | 19 namespace syncer { |
| 20 | 20 |
| 21 class FakeSyncEncryptionHandler; |
| 22 |
| 21 class FakeSyncManager : public SyncManager { | 23 class FakeSyncManager : public SyncManager { |
| 22 public: | 24 public: |
| 23 // |initial_sync_ended_types|: The set of types that have initial_sync_ended | 25 // |initial_sync_ended_types|: The set of types that have initial_sync_ended |
| 24 // set to true. This value will be used by InitialSyncEndedTypes() until the | 26 // set to true. This value will be used by InitialSyncEndedTypes() until the |
| 25 // next configuration is performed. | 27 // next configuration is performed. |
| 26 // | 28 // |
| 27 // |progress_marker_types|: The set of types that have valid progress | 29 // |progress_marker_types|: The set of types that have valid progress |
| 28 // markers. This will be used by GetTypesWithEmptyProgressMarkerToken() until | 30 // markers. This will be used by GetTypesWithEmptyProgressMarkerToken() until |
| 29 // the next configuration is performed. | 31 // the next configuration is performed. |
| 30 // | 32 // |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 virtual void UpdateEnabledTypes(const ModelTypeSet& types) OVERRIDE; | 98 virtual void UpdateEnabledTypes(const ModelTypeSet& types) OVERRIDE; |
| 97 virtual void RegisterInvalidationHandler( | 99 virtual void RegisterInvalidationHandler( |
| 98 SyncNotifierObserver* handler) OVERRIDE; | 100 SyncNotifierObserver* handler) OVERRIDE; |
| 99 virtual void UpdateRegisteredInvalidationIds( | 101 virtual void UpdateRegisteredInvalidationIds( |
| 100 SyncNotifierObserver* handler, | 102 SyncNotifierObserver* handler, |
| 101 const ObjectIdSet& ids) OVERRIDE; | 103 const ObjectIdSet& ids) OVERRIDE; |
| 102 virtual void UnregisterInvalidationHandler( | 104 virtual void UnregisterInvalidationHandler( |
| 103 SyncNotifierObserver* handler) OVERRIDE; | 105 SyncNotifierObserver* handler) OVERRIDE; |
| 104 virtual void StartSyncingNormally( | 106 virtual void StartSyncingNormally( |
| 105 const ModelSafeRoutingInfo& routing_info) OVERRIDE; | 107 const ModelSafeRoutingInfo& routing_info) OVERRIDE; |
| 106 virtual void SetEncryptionPassphrase(const std::string& passphrase, | |
| 107 bool is_explicit) OVERRIDE; | |
| 108 virtual void SetDecryptionPassphrase(const std::string& passphrase) OVERRIDE; | |
| 109 virtual void ConfigureSyncer( | 108 virtual void ConfigureSyncer( |
| 110 ConfigureReason reason, | 109 ConfigureReason reason, |
| 111 const ModelTypeSet& types_to_config, | 110 const ModelTypeSet& types_to_config, |
| 112 const ModelSafeRoutingInfo& new_routing_info, | 111 const ModelSafeRoutingInfo& new_routing_info, |
| 113 const base::Closure& ready_task, | 112 const base::Closure& ready_task, |
| 114 const base::Closure& retry_task) OVERRIDE; | 113 const base::Closure& retry_task) OVERRIDE; |
| 115 virtual void AddObserver(Observer* observer) OVERRIDE; | 114 virtual void AddObserver(Observer* observer) OVERRIDE; |
| 116 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 115 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
| 117 virtual SyncStatus GetDetailedStatus() const OVERRIDE; | 116 virtual SyncStatus GetDetailedStatus() const OVERRIDE; |
| 118 virtual bool IsUsingExplicitPassphrase() OVERRIDE; | |
| 119 virtual bool GetKeystoreKeyBootstrapToken(std::string* token) OVERRIDE; | 117 virtual bool GetKeystoreKeyBootstrapToken(std::string* token) OVERRIDE; |
| 120 virtual void SaveChanges() OVERRIDE; | 118 virtual void SaveChanges() OVERRIDE; |
| 121 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE; | 119 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE; |
| 122 virtual void ShutdownOnSyncThread() OVERRIDE; | 120 virtual void ShutdownOnSyncThread() OVERRIDE; |
| 123 virtual UserShare* GetUserShare() OVERRIDE; | 121 virtual UserShare* GetUserShare() OVERRIDE; |
| 124 virtual void RefreshNigori(const std::string& chrome_version, | |
| 125 const base::Closure& done_callback) OVERRIDE; | |
| 126 virtual void EnableEncryptEverything() OVERRIDE; | |
| 127 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; | 122 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; |
| 128 virtual bool HasUnsyncedItems() OVERRIDE; | 123 virtual bool HasUnsyncedItems() OVERRIDE; |
| 124 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; |
| 129 | 125 |
| 130 private: | 126 private: |
| 131 void InvalidateOnSyncThread( | 127 void InvalidateOnSyncThread( |
| 132 const ObjectIdPayloadMap& id_payloads, | 128 const ObjectIdPayloadMap& id_payloads, |
| 133 IncomingNotificationSource source); | 129 IncomingNotificationSource source); |
| 134 void EnableNotificationsOnSyncThread(); | 130 void EnableNotificationsOnSyncThread(); |
| 135 void DisableNotificationsOnSyncThread(NotificationsDisabledReason reason); | 131 void DisableNotificationsOnSyncThread(NotificationsDisabledReason reason); |
| 136 | 132 |
| 137 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; | 133 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; |
| 138 | 134 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 149 // The set of types that have been cleaned up. | 145 // The set of types that have been cleaned up. |
| 150 ModelTypeSet cleaned_types_; | 146 ModelTypeSet cleaned_types_; |
| 151 // The set of types that have been downloaded. | 147 // The set of types that have been downloaded. |
| 152 ModelTypeSet downloaded_types_; | 148 ModelTypeSet downloaded_types_; |
| 153 // The set of types that have been enabled. | 149 // The set of types that have been enabled. |
| 154 ModelTypeSet enabled_types_; | 150 ModelTypeSet enabled_types_; |
| 155 | 151 |
| 156 // Faked notifier state. | 152 // Faked notifier state. |
| 157 SyncNotifierRegistrar registrar_; | 153 SyncNotifierRegistrar registrar_; |
| 158 | 154 |
| 155 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_; |
| 156 |
| 159 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); | 157 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); |
| 160 }; | 158 }; |
| 161 | 159 |
| 162 } // namespace syncer | 160 } // namespace syncer |
| 163 | 161 |
| 164 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 162 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
| OLD | NEW |