| 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" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Returns the types that have most recently received a refresh request. | 59 // Returns the types that have most recently received a refresh request. |
| 60 ModelTypeSet GetLastRefreshRequestTypes(); | 60 ModelTypeSet GetLastRefreshRequestTypes(); |
| 61 | 61 |
| 62 // Returns the most recent configuration reason since the last call to | 62 // Returns the most recent configuration reason since the last call to |
| 63 // GetAndResetConfigureReason, or since startup if never called. | 63 // GetAndResetConfigureReason, or since startup if never called. |
| 64 ConfigureReason GetAndResetConfigureReason(); | 64 ConfigureReason GetAndResetConfigureReason(); |
| 65 | 65 |
| 66 // Posts a method to invalidate the given IDs on the sync thread. | 66 // Posts a method to invalidate the given IDs on the sync thread. |
| 67 virtual void OnIncomingInvalidation( | 67 virtual void OnIncomingInvalidation( |
| 68 syncer::ModelType type, | 68 syncer::ModelType type, |
| 69 scoped_ptr<InvalidationInterface> interface) OVERRIDE; | 69 scoped_ptr<InvalidationInterface> interface) override; |
| 70 | 70 |
| 71 // Posts a method to update the invalidator state on the sync thread. | 71 // Posts a method to update the invalidator state on the sync thread. |
| 72 virtual void SetInvalidatorEnabled(bool invalidator_enabled) OVERRIDE; | 72 virtual void SetInvalidatorEnabled(bool invalidator_enabled) override; |
| 73 | 73 |
| 74 // Block until the sync thread has finished processing any pending messages. | 74 // Block until the sync thread has finished processing any pending messages. |
| 75 void WaitForSyncThread(); | 75 void WaitForSyncThread(); |
| 76 | 76 |
| 77 // SyncManager implementation. | 77 // SyncManager implementation. |
| 78 // Note: we treat whatever message loop this is called from as the sync | 78 // Note: we treat whatever message loop this is called from as the sync |
| 79 // loop for purposes of callbacks. | 79 // loop for purposes of callbacks. |
| 80 virtual void Init(InitArgs* args) OVERRIDE; | 80 virtual void Init(InitArgs* args) override; |
| 81 virtual ModelTypeSet InitialSyncEndedTypes() OVERRIDE; | 81 virtual ModelTypeSet InitialSyncEndedTypes() override; |
| 82 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( | 82 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( |
| 83 ModelTypeSet types) OVERRIDE; | 83 ModelTypeSet types) override; |
| 84 virtual bool PurgePartiallySyncedTypes() OVERRIDE; | 84 virtual bool PurgePartiallySyncedTypes() override; |
| 85 virtual void UpdateCredentials(const SyncCredentials& credentials) OVERRIDE; | 85 virtual void UpdateCredentials(const SyncCredentials& credentials) override; |
| 86 virtual void StartSyncingNormally( | 86 virtual void StartSyncingNormally( |
| 87 const ModelSafeRoutingInfo& routing_info) OVERRIDE; | 87 const ModelSafeRoutingInfo& routing_info) override; |
| 88 virtual void ConfigureSyncer( | 88 virtual void ConfigureSyncer( |
| 89 ConfigureReason reason, | 89 ConfigureReason reason, |
| 90 ModelTypeSet to_download, | 90 ModelTypeSet to_download, |
| 91 ModelTypeSet to_purge, | 91 ModelTypeSet to_purge, |
| 92 ModelTypeSet to_journal, | 92 ModelTypeSet to_journal, |
| 93 ModelTypeSet to_unapply, | 93 ModelTypeSet to_unapply, |
| 94 const ModelSafeRoutingInfo& new_routing_info, | 94 const ModelSafeRoutingInfo& new_routing_info, |
| 95 const base::Closure& ready_task, | 95 const base::Closure& ready_task, |
| 96 const base::Closure& retry_task) OVERRIDE; | 96 const base::Closure& retry_task) override; |
| 97 virtual void AddObserver(Observer* observer) OVERRIDE; | 97 virtual void AddObserver(Observer* observer) override; |
| 98 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 98 virtual void RemoveObserver(Observer* observer) override; |
| 99 virtual SyncStatus GetDetailedStatus() const OVERRIDE; | 99 virtual SyncStatus GetDetailedStatus() const override; |
| 100 virtual void SaveChanges() OVERRIDE; | 100 virtual void SaveChanges() override; |
| 101 virtual void ShutdownOnSyncThread(ShutdownReason reason) OVERRIDE; | 101 virtual void ShutdownOnSyncThread(ShutdownReason reason) override; |
| 102 virtual UserShare* GetUserShare() OVERRIDE; | 102 virtual UserShare* GetUserShare() override; |
| 103 virtual syncer::SyncContextProxy* GetSyncContextProxy() OVERRIDE; | 103 virtual syncer::SyncContextProxy* GetSyncContextProxy() override; |
| 104 virtual const std::string cache_guid() OVERRIDE; | 104 virtual const std::string cache_guid() override; |
| 105 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; | 105 virtual bool ReceivedExperiment(Experiments* experiments) override; |
| 106 virtual bool HasUnsyncedItems() OVERRIDE; | 106 virtual bool HasUnsyncedItems() override; |
| 107 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE; | 107 virtual SyncEncryptionHandler* GetEncryptionHandler() override; |
| 108 virtual ScopedVector<syncer::ProtocolEvent> | 108 virtual ScopedVector<syncer::ProtocolEvent> |
| 109 GetBufferedProtocolEvents() OVERRIDE; | 109 GetBufferedProtocolEvents() override; |
| 110 virtual scoped_ptr<base::ListValue> GetAllNodesForType( | 110 virtual scoped_ptr<base::ListValue> GetAllNodesForType( |
| 111 syncer::ModelType type) OVERRIDE; | 111 syncer::ModelType type) override; |
| 112 virtual void RefreshTypes(ModelTypeSet types) OVERRIDE; | 112 virtual void RefreshTypes(ModelTypeSet types) override; |
| 113 virtual void RegisterDirectoryTypeDebugInfoObserver( | 113 virtual void RegisterDirectoryTypeDebugInfoObserver( |
| 114 syncer::TypeDebugInfoObserver* observer) OVERRIDE; | 114 syncer::TypeDebugInfoObserver* observer) override; |
| 115 virtual void UnregisterDirectoryTypeDebugInfoObserver( | 115 virtual void UnregisterDirectoryTypeDebugInfoObserver( |
| 116 syncer::TypeDebugInfoObserver* observer) OVERRIDE; | 116 syncer::TypeDebugInfoObserver* observer) override; |
| 117 virtual bool HasDirectoryTypeDebugInfoObserver( | 117 virtual bool HasDirectoryTypeDebugInfoObserver( |
| 118 syncer::TypeDebugInfoObserver* observer) OVERRIDE; | 118 syncer::TypeDebugInfoObserver* observer) override; |
| 119 virtual void RequestEmitDebugInfo() OVERRIDE; | 119 virtual void RequestEmitDebugInfo() override; |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; | 122 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; |
| 123 | 123 |
| 124 ObserverList<SyncManager::Observer> observers_; | 124 ObserverList<SyncManager::Observer> observers_; |
| 125 | 125 |
| 126 // Faked directory state. | 126 // Faked directory state. |
| 127 ModelTypeSet initial_sync_ended_types_; | 127 ModelTypeSet initial_sync_ended_types_; |
| 128 ModelTypeSet progress_marker_types_; | 128 ModelTypeSet progress_marker_types_; |
| 129 | 129 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 149 TestUserShare test_user_share_; | 149 TestUserShare test_user_share_; |
| 150 | 150 |
| 151 NullSyncContextProxy null_sync_context_proxy_; | 151 NullSyncContextProxy null_sync_context_proxy_; |
| 152 | 152 |
| 153 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); | 153 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 } // namespace syncer | 156 } // namespace syncer |
| 157 | 157 |
| 158 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ | 158 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ |
| OLD | NEW |