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

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

Issue 9395058: [Sync] Remove SyncableServiceAdapter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/glue/fake_generic_change_processor.h"
6
7 #include "base/location.h"
8 #include "base/memory/weak_ptr.h"
9 #include "chrome/browser/sync/api/syncable_service.h"
10
11 namespace browser_sync {
12
13 FakeGenericChangeProcessor::FakeGenericChangeProcessor()
14 : GenericChangeProcessor(NULL, base::WeakPtr<SyncableService>(), NULL)
15 sync_model_has_user_created_nodes_(true),
16 sync_model_has_user_created_nodes_success_(true),
17 crypto_ready_if_necessary_(true),
18 type_(syncable::UNSPECIFIED) {}
19 FakeGenericChangeProcessor::~FakeGenericChangeProcessor() {}
akalin 2012/03/06 02:33:47 extra newline before
Nicolas Zea 2012/03/06 18:27:14 Done.
20
21 void FakeGenericChangeProcessor::set_process_sync_changes_error(
22 const SyncError& error) {
23 process_sync_changes_error_ = error;
24 }
25 void FakeGenericChangeProcessor::set_get_sync_data_for_type_error(
26 const SyncError& error) {
27 get_sync_data_for_type_error_ = error;
28 }
29 void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes(
30 bool has_nodes) {
31 sync_model_has_user_created_nodes_ = has_nodes;
32 }
33 void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes_success(
34 bool success) {
35 sync_model_has_user_created_nodes_success_ = success;
36 }
37 void FakeGenericChangeProcessor::set_crypto_ready_if_necessary(
38 bool crypto_ready) {
39 crypto_ready_if_necessary_ = crypto_ready;
40 }
41
42 SyncError FakeGenericChangeProcessor::ProcessSyncChanges(
43 const tracked_objects::Location& from_here,
44 const SyncChangeList& change_list) {
45 return process_sync_changes_error_;
46 }
47
48 SyncError FakeGenericChangeProcessor::GetSyncDataForType(
49 syncable::ModelType type, SyncDataList* current_sync_data) {
50 type_ = type;
51 return get_sync_data_for_type_error_;
52 }
53
54 bool FakeGenericChangeProcessor::SyncModelHasUserCreatedNodes(
55 syncable::ModelType type, bool* has_nodes) {
56 type_ = type;
57 *has_nodes = sync_model_has_user_created_nodes_;
58 return sync_model_has_user_created_nodes_success_;
59 }
60
61 bool FakeGenericChangeProcessor::CryptoReadyIfNecessary(
62 syncable::ModelType type) {
63 type_ = type;
64 return crypto_ready_if_necessary_;
65 }
66
67 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698