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

Side by Side Diff: sync/internal_api/test/fake_sync_manager.cc

Issue 10827266: [Sync] Add SyncEncryptionHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 #include "sync/internal_api/public/test/fake_sync_manager.h" 5 #include "sync/internal_api/public/test/fake_sync_manager.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 SyncNotifierObserver* handler, 152 SyncNotifierObserver* handler,
153 const ObjectIdSet& ids) { 153 const ObjectIdSet& ids) {
154 notifier_helper_.UpdateRegisteredIds(handler, ids); 154 notifier_helper_.UpdateRegisteredIds(handler, ids);
155 } 155 }
156 156
157 void FakeSyncManager::StartSyncingNormally( 157 void FakeSyncManager::StartSyncingNormally(
158 const ModelSafeRoutingInfo& routing_info) { 158 const ModelSafeRoutingInfo& routing_info) {
159 // Do nothing. 159 // Do nothing.
160 } 160 }
161 161
162 void FakeSyncManager::SetEncryptionPassphrase(const std::string& passphrase,
163 bool is_explicit) {
164 NOTIMPLEMENTED();
165 }
166
167 void FakeSyncManager::SetDecryptionPassphrase(const std::string& passphrase) {
168 NOTIMPLEMENTED();
169 }
170
171 void FakeSyncManager::ConfigureSyncer( 162 void FakeSyncManager::ConfigureSyncer(
172 ConfigureReason reason, 163 ConfigureReason reason,
173 const ModelTypeSet& types_to_config, 164 const ModelTypeSet& types_to_config,
174 const ModelSafeRoutingInfo& new_routing_info, 165 const ModelSafeRoutingInfo& new_routing_info,
175 const base::Closure& ready_task, 166 const base::Closure& ready_task,
176 const base::Closure& retry_task) { 167 const base::Closure& retry_task) {
177 ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info); 168 ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info);
178 ModelTypeSet disabled_types = Difference( 169 ModelTypeSet disabled_types = Difference(
179 ModelTypeSet::All(), enabled_types); 170 ModelTypeSet::All(), enabled_types);
180 ModelTypeSet success_types = types_to_config; 171 ModelTypeSet success_types = types_to_config;
(...skipping 26 matching lines...) Expand all
207 198
208 void FakeSyncManager::RemoveObserver(Observer* observer) { 199 void FakeSyncManager::RemoveObserver(Observer* observer) {
209 observers_.RemoveObserver(observer); 200 observers_.RemoveObserver(observer);
210 } 201 }
211 202
212 SyncStatus FakeSyncManager::GetDetailedStatus() const { 203 SyncStatus FakeSyncManager::GetDetailedStatus() const {
213 NOTIMPLEMENTED(); 204 NOTIMPLEMENTED();
214 return SyncStatus(); 205 return SyncStatus();
215 } 206 }
216 207
217 bool FakeSyncManager::IsUsingExplicitPassphrase() {
218 NOTIMPLEMENTED();
219 return false;
220 }
221
222 bool FakeSyncManager::GetKeystoreKeyBootstrapToken(std::string* token) { 208 bool FakeSyncManager::GetKeystoreKeyBootstrapToken(std::string* token) {
223 return false; 209 return false;
224 } 210 }
225 211
226 void FakeSyncManager::SaveChanges() { 212 void FakeSyncManager::SaveChanges() {
227 // Do nothing. 213 // Do nothing.
228 } 214 }
229 215
230 void FakeSyncManager::StopSyncingForShutdown(const base::Closure& callback) { 216 void FakeSyncManager::StopSyncingForShutdown(const base::Closure& callback) {
231 if (!sync_task_runner_->PostTask(FROM_HERE, callback)) { 217 if (!sync_task_runner_->PostTask(FROM_HERE, callback)) {
232 NOTREACHED(); 218 NOTREACHED();
233 } 219 }
234 } 220 }
235 221
236 void FakeSyncManager::ShutdownOnSyncThread() { 222 void FakeSyncManager::ShutdownOnSyncThread() {
237 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); 223 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
238 } 224 }
239 225
240 UserShare* FakeSyncManager::GetUserShare() { 226 UserShare* FakeSyncManager::GetUserShare() {
241 NOTIMPLEMENTED();
242 return NULL; 227 return NULL;
243 } 228 }
244 229
245 void FakeSyncManager::RefreshNigori(const std::string& chrome_version,
246 const base::Closure& done_callback) {
247 done_callback.Run();
248 }
249
250 void FakeSyncManager::EnableEncryptEverything() {
251 NOTIMPLEMENTED();
252 }
253
254 bool FakeSyncManager::ReceivedExperiment(Experiments* experiments) {
255 return false;
256 }
257
258 bool FakeSyncManager::HasUnsyncedItems() { 230 bool FakeSyncManager::HasUnsyncedItems() {
259 NOTIMPLEMENTED(); 231 NOTIMPLEMENTED();
260 return false; 232 return false;
261 } 233 }
262 234
235 SyncEncryptionHandler* FakeSyncManager::GetEncryptionHandler() {
236 return &fake_encryption_handler_;
237 }
238
263 void FakeSyncManager::InvalidateOnSyncThread( 239 void FakeSyncManager::InvalidateOnSyncThread(
264 const ObjectIdPayloadMap& id_payloads, 240 const ObjectIdPayloadMap& id_payloads,
265 IncomingNotificationSource source) { 241 IncomingNotificationSource source) {
266 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); 242 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
267 notifier_helper_.DispatchInvalidationsToHandlers(id_payloads, source); 243 notifier_helper_.DispatchInvalidationsToHandlers(id_payloads, source);
268 } 244 }
269 245
270 void FakeSyncManager::EnableNotificationsOnSyncThread() { 246 void FakeSyncManager::EnableNotificationsOnSyncThread() {
271 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); 247 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
272 notifier_helper_.EmitOnNotificationsEnabled(); 248 notifier_helper_.EmitOnNotificationsEnabled();
273 } 249 }
274 250
275 void FakeSyncManager::DisableNotificationsOnSyncThread( 251 void FakeSyncManager::DisableNotificationsOnSyncThread(
276 NotificationsDisabledReason reason) { 252 NotificationsDisabledReason reason) {
277 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread()); 253 DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
278 notifier_helper_.EmitOnNotificationsDisabled(reason); 254 notifier_helper_.EmitOnNotificationsDisabled(reason);
279 } 255 }
280 256
281 } // namespace syncer 257 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698