Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: sync/internal_api/public/test/fake_sync_manager.h

Issue 10827266: [Sync] Add SyncEncryptionHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_helper.h" 13 #include "sync/notifier/sync_notifier_helper.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 explicit FakeSyncManager(); 25 explicit FakeSyncManager();
24 virtual ~FakeSyncManager(); 26 virtual ~FakeSyncManager();
25 27
26 // The set of types that have initial_sync_ended set to true. This value will 28 // The set of types that have initial_sync_ended set to true. This value will
27 // be used by InitialSyncEndedTypes() until the next configuration is 29 // be used by InitialSyncEndedTypes() until the next configuration is
28 // performed. 30 // performed.
29 void set_initial_sync_ended_types(ModelTypeSet types); 31 void set_initial_sync_ended_types(ModelTypeSet types);
30 32
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken( 94 virtual ModelTypeSet GetTypesWithEmptyProgressMarkerToken(
93 ModelTypeSet types) OVERRIDE; 95 ModelTypeSet types) OVERRIDE;
94 virtual bool PurgePartiallySyncedTypes() OVERRIDE; 96 virtual bool PurgePartiallySyncedTypes() OVERRIDE;
95 virtual void UpdateCredentials(const SyncCredentials& credentials) OVERRIDE; 97 virtual void UpdateCredentials(const SyncCredentials& credentials) OVERRIDE;
96 virtual void UpdateEnabledTypes(const ModelTypeSet& types) OVERRIDE; 98 virtual void UpdateEnabledTypes(const ModelTypeSet& types) OVERRIDE;
97 virtual void UpdateRegisteredInvalidationIds( 99 virtual void UpdateRegisteredInvalidationIds(
98 SyncNotifierObserver* handler, 100 SyncNotifierObserver* handler,
99 const ObjectIdSet& ids) OVERRIDE; 101 const ObjectIdSet& ids) OVERRIDE;
100 virtual void StartSyncingNormally( 102 virtual void StartSyncingNormally(
101 const ModelSafeRoutingInfo& routing_info) OVERRIDE; 103 const ModelSafeRoutingInfo& routing_info) OVERRIDE;
102 virtual void SetEncryptionPassphrase(const std::string& passphrase,
103 bool is_explicit) OVERRIDE;
104 virtual void SetDecryptionPassphrase(const std::string& passphrase) OVERRIDE;
105 virtual void ConfigureSyncer( 104 virtual void ConfigureSyncer(
106 ConfigureReason reason, 105 ConfigureReason reason,
107 const ModelTypeSet& types_to_config, 106 const ModelTypeSet& types_to_config,
108 const ModelSafeRoutingInfo& new_routing_info, 107 const ModelSafeRoutingInfo& new_routing_info,
109 const base::Closure& ready_task, 108 const base::Closure& ready_task,
110 const base::Closure& retry_task) OVERRIDE; 109 const base::Closure& retry_task) OVERRIDE;
111 virtual void AddObserver(Observer* observer) OVERRIDE; 110 virtual void AddObserver(Observer* observer) OVERRIDE;
112 virtual void RemoveObserver(Observer* observer) OVERRIDE; 111 virtual void RemoveObserver(Observer* observer) OVERRIDE;
113 virtual SyncStatus GetDetailedStatus() const OVERRIDE; 112 virtual SyncStatus GetDetailedStatus() const OVERRIDE;
114 virtual bool IsUsingExplicitPassphrase() OVERRIDE;
115 virtual bool GetKeystoreKeyBootstrapToken(std::string* token) OVERRIDE; 113 virtual bool GetKeystoreKeyBootstrapToken(std::string* token) OVERRIDE;
116 virtual void SaveChanges() OVERRIDE; 114 virtual void SaveChanges() OVERRIDE;
117 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE; 115 virtual void StopSyncingForShutdown(const base::Closure& callback) OVERRIDE;
118 virtual void ShutdownOnSyncThread() OVERRIDE; 116 virtual void ShutdownOnSyncThread() OVERRIDE;
119 virtual UserShare* GetUserShare() OVERRIDE; 117 virtual UserShare* GetUserShare() OVERRIDE;
120 virtual void RefreshNigori(const std::string& chrome_version,
121 const base::Closure& done_callback) OVERRIDE;
122 virtual void EnableEncryptEverything() OVERRIDE;
123 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE; 118 virtual bool ReceivedExperiment(Experiments* experiments) OVERRIDE;
124 virtual bool HasUnsyncedItems() OVERRIDE; 119 virtual bool HasUnsyncedItems() OVERRIDE;
120 virtual SyncEncryptionHandler* GetEncryptionHandler() OVERRIDE;
125 121
126 private: 122 private:
127 void InvalidateOnSyncThread( 123 void InvalidateOnSyncThread(
128 const ObjectIdPayloadMap& id_payloads, 124 const ObjectIdPayloadMap& id_payloads,
129 IncomingNotificationSource source); 125 IncomingNotificationSource source);
130 void EnableNotificationsOnSyncThread(); 126 void EnableNotificationsOnSyncThread();
131 void DisableNotificationsOnSyncThread(NotificationsDisabledReason reason); 127 void DisableNotificationsOnSyncThread(NotificationsDisabledReason reason);
132 128
133 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_; 129 scoped_refptr<base::SequencedTaskRunner> sync_task_runner_;
134 130
(...skipping 10 matching lines...) Expand all
145 // The set of types that have been cleaned up. 141 // The set of types that have been cleaned up.
146 ModelTypeSet cleaned_types_; 142 ModelTypeSet cleaned_types_;
147 // The set of types that have been downloaded. 143 // The set of types that have been downloaded.
148 ModelTypeSet downloaded_types_; 144 ModelTypeSet downloaded_types_;
149 // The set of types that have been enabled. 145 // The set of types that have been enabled.
150 ModelTypeSet enabled_types_; 146 ModelTypeSet enabled_types_;
151 147
152 // Faked notifier state. 148 // Faked notifier state.
153 SyncNotifierHelper notifier_helper_; 149 SyncNotifierHelper notifier_helper_;
154 150
151 scoped_ptr<FakeSyncEncryptionHandler> fake_encryption_handler_;
152
155 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager); 153 DISALLOW_COPY_AND_ASSIGN(FakeSyncManager);
156 }; 154 };
157 155
158 } // namespace syncer 156 } // namespace syncer
159 157
160 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ 158 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698