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

Side by Side Diff: chrome/browser/sync/glue/fake_generic_change_processor.cc

Issue 23129007: sync: Add GetAllSyncData to sync/api (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 7 years, 3 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 "chrome/browser/sync/glue/fake_generic_change_processor.h" 5 #include "chrome/browser/sync/glue/fake_generic_change_processor.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "sync/api/syncable_service.h" 9 #include "sync/api/syncable_service.h"
10 10
11 namespace browser_sync { 11 namespace browser_sync {
12 12
13 FakeGenericChangeProcessor::FakeGenericChangeProcessor() 13 FakeGenericChangeProcessor::FakeGenericChangeProcessor()
14 : GenericChangeProcessor( 14 : GenericChangeProcessor(
15 NULL, 15 NULL,
16 base::WeakPtr<syncer::SyncableService>(), 16 base::WeakPtr<syncer::SyncableService>(),
17 base::WeakPtr<syncer::SyncMergeResult>(), 17 base::WeakPtr<syncer::SyncMergeResult>(),
18 NULL), 18 NULL),
19 sync_model_has_user_created_nodes_(true), 19 sync_model_has_user_created_nodes_(true),
20 sync_model_has_user_created_nodes_success_(true), 20 sync_model_has_user_created_nodes_success_(true),
21 crypto_ready_if_necessary_(true), 21 crypto_ready_if_necessary_(true) {}
22 type_(syncer::UNSPECIFIED) {}
23 22
24 FakeGenericChangeProcessor::~FakeGenericChangeProcessor() {} 23 FakeGenericChangeProcessor::~FakeGenericChangeProcessor() {}
25 24
26 void FakeGenericChangeProcessor::set_process_sync_changes_error( 25 void FakeGenericChangeProcessor::set_process_sync_changes_error(
27 const syncer::SyncError& error) { 26 const syncer::SyncError& error) {
28 process_sync_changes_error_ = error; 27 process_sync_changes_error_ = error;
29 } 28 }
30 void FakeGenericChangeProcessor::set_get_sync_data_for_type_error( 29 void FakeGenericChangeProcessor::set_get_sync_data_for_type_error(
31 const syncer::SyncError& error) { 30 const syncer::SyncError& error) {
32 get_sync_data_for_type_error_ = error; 31 get_sync_data_for_type_error_ = error;
(...skipping 10 matching lines...) Expand all
43 bool crypto_ready) { 42 bool crypto_ready) {
44 crypto_ready_if_necessary_ = crypto_ready; 43 crypto_ready_if_necessary_ = crypto_ready;
45 } 44 }
46 45
47 syncer::SyncError FakeGenericChangeProcessor::ProcessSyncChanges( 46 syncer::SyncError FakeGenericChangeProcessor::ProcessSyncChanges(
48 const tracked_objects::Location& from_here, 47 const tracked_objects::Location& from_here,
49 const syncer::SyncChangeList& change_list) { 48 const syncer::SyncChangeList& change_list) {
50 return process_sync_changes_error_; 49 return process_sync_changes_error_;
51 } 50 }
52 51
53 syncer::SyncError FakeGenericChangeProcessor::GetSyncDataForType( 52 syncer::SyncError FakeGenericChangeProcessor::GetAllSyncDataReturnError(
54 syncer::ModelType type, syncer::SyncDataList* current_sync_data) { 53 syncer::ModelType type, syncer::SyncDataList* current_sync_data) const {
55 type_ = type;
56 return get_sync_data_for_type_error_; 54 return get_sync_data_for_type_error_;
57 } 55 }
58 56
59 int FakeGenericChangeProcessor::GetSyncCountForType(syncer::ModelType type) { 57 int FakeGenericChangeProcessor::GetSyncCountForType(syncer::ModelType type) {
60 return 0; 58 return 0;
61 } 59 }
62 60
63 bool FakeGenericChangeProcessor::SyncModelHasUserCreatedNodes( 61 bool FakeGenericChangeProcessor::SyncModelHasUserCreatedNodes(
64 syncer::ModelType type, bool* has_nodes) { 62 syncer::ModelType type, bool* has_nodes) {
65 type_ = type;
66 *has_nodes = sync_model_has_user_created_nodes_; 63 *has_nodes = sync_model_has_user_created_nodes_;
67 return sync_model_has_user_created_nodes_success_; 64 return sync_model_has_user_created_nodes_success_;
68 } 65 }
69 66
70 bool FakeGenericChangeProcessor::CryptoReadyIfNecessary( 67 bool FakeGenericChangeProcessor::CryptoReadyIfNecessary(
71 syncer::ModelType type) { 68 syncer::ModelType type) {
72 type_ = type;
73 return crypto_ready_if_necessary_; 69 return crypto_ready_if_necessary_;
74 } 70 }
75 71
76 } // namespace browser_sync 72 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/fake_generic_change_processor.h ('k') | chrome/browser/sync/glue/favicon_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698