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

Side by Side Diff: components/sync_driver/fake_generic_change_processor.cc

Issue 2203673002: [Sync] Move //components/sync_driver to //components/sync/driver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sd-a
Patch Set: Full change rebased on static lib. Created 4 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/sync_driver/fake_generic_change_processor.h"
6
7 #include <utility>
8
9 #include "base/location.h"
10 #include "base/memory/weak_ptr.h"
11 #include "components/sync/api/syncable_service.h"
12 #include "components/sync/core/attachments/attachment_service_impl.h"
13
14 namespace sync_driver {
15
16 FakeGenericChangeProcessor::FakeGenericChangeProcessor(
17 syncer::ModelType type,
18 SyncClient* sync_client)
19 : GenericChangeProcessor(type,
20 NULL,
21 base::WeakPtr<syncer::SyncableService>(),
22 base::WeakPtr<syncer::SyncMergeResult>(),
23 NULL,
24 sync_client,
25 nullptr),
26 sync_model_has_user_created_nodes_(true),
27 sync_model_has_user_created_nodes_success_(true) {
28 }
29
30 FakeGenericChangeProcessor::~FakeGenericChangeProcessor() {}
31
32 void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes(
33 bool has_nodes) {
34 sync_model_has_user_created_nodes_ = has_nodes;
35 }
36 void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes_success(
37 bool success) {
38 sync_model_has_user_created_nodes_success_ = success;
39 }
40
41 syncer::SyncError FakeGenericChangeProcessor::ProcessSyncChanges(
42 const tracked_objects::Location& from_here,
43 const syncer::SyncChangeList& change_list) {
44 return syncer::SyncError();
45 }
46
47 syncer::SyncError FakeGenericChangeProcessor::GetAllSyncDataReturnError(
48 syncer::SyncDataList* current_sync_data) const {
49 return syncer::SyncError();
50 }
51
52 bool FakeGenericChangeProcessor::GetDataTypeContext(
53 std::string* context) const {
54 return false;
55 }
56
57 int FakeGenericChangeProcessor::GetSyncCount() {
58 return 0;
59 }
60
61 bool FakeGenericChangeProcessor::SyncModelHasUserCreatedNodes(bool* has_nodes) {
62 *has_nodes = sync_model_has_user_created_nodes_;
63 return sync_model_has_user_created_nodes_success_;
64 }
65
66 bool FakeGenericChangeProcessor::CryptoReadyIfNecessary() {
67 return true;
68 }
69
70 FakeGenericChangeProcessorFactory::FakeGenericChangeProcessorFactory(
71 std::unique_ptr<FakeGenericChangeProcessor> processor)
72 : processor_(std::move(processor)) {}
73
74 FakeGenericChangeProcessorFactory::~FakeGenericChangeProcessorFactory() {}
75
76 std::unique_ptr<GenericChangeProcessor>
77 FakeGenericChangeProcessorFactory::CreateGenericChangeProcessor(
78 syncer::ModelType type,
79 syncer::UserShare* user_share,
80 syncer::DataTypeErrorHandler* error_handler,
81 const base::WeakPtr<syncer::SyncableService>& local_service,
82 const base::WeakPtr<syncer::SyncMergeResult>& merge_result,
83 SyncClient* sync_client) {
84 return std::move(processor_);
85 }
86
87 } // namespace sync_driver
OLDNEW
« no previous file with comments | « components/sync_driver/fake_generic_change_processor.h ('k') | components/sync_driver/fake_sync_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698