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

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

Issue 10662035: [Sync] Put everything in sync/api into csync namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comments Created 8 years, 6 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(NULL, base::WeakPtr<SyncableService>(), NULL), 14 : GenericChangeProcessor(
15 NULL, base::WeakPtr<csync::SyncableService>(), NULL),
15 sync_model_has_user_created_nodes_(true), 16 sync_model_has_user_created_nodes_(true),
16 sync_model_has_user_created_nodes_success_(true), 17 sync_model_has_user_created_nodes_success_(true),
17 crypto_ready_if_necessary_(true), 18 crypto_ready_if_necessary_(true),
18 type_(syncable::UNSPECIFIED) {} 19 type_(syncable::UNSPECIFIED) {}
19 20
20 FakeGenericChangeProcessor::~FakeGenericChangeProcessor() {} 21 FakeGenericChangeProcessor::~FakeGenericChangeProcessor() {}
21 22
22 void FakeGenericChangeProcessor::set_process_sync_changes_error( 23 void FakeGenericChangeProcessor::set_process_sync_changes_error(
23 const SyncError& error) { 24 const csync::SyncError& error) {
24 process_sync_changes_error_ = error; 25 process_sync_changes_error_ = error;
25 } 26 }
26 void FakeGenericChangeProcessor::set_get_sync_data_for_type_error( 27 void FakeGenericChangeProcessor::set_get_sync_data_for_type_error(
27 const SyncError& error) { 28 const csync::SyncError& error) {
28 get_sync_data_for_type_error_ = error; 29 get_sync_data_for_type_error_ = error;
29 } 30 }
30 void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes( 31 void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes(
31 bool has_nodes) { 32 bool has_nodes) {
32 sync_model_has_user_created_nodes_ = has_nodes; 33 sync_model_has_user_created_nodes_ = has_nodes;
33 } 34 }
34 void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes_success( 35 void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes_success(
35 bool success) { 36 bool success) {
36 sync_model_has_user_created_nodes_success_ = success; 37 sync_model_has_user_created_nodes_success_ = success;
37 } 38 }
38 void FakeGenericChangeProcessor::set_crypto_ready_if_necessary( 39 void FakeGenericChangeProcessor::set_crypto_ready_if_necessary(
39 bool crypto_ready) { 40 bool crypto_ready) {
40 crypto_ready_if_necessary_ = crypto_ready; 41 crypto_ready_if_necessary_ = crypto_ready;
41 } 42 }
42 43
43 SyncError FakeGenericChangeProcessor::ProcessSyncChanges( 44 csync::SyncError FakeGenericChangeProcessor::ProcessSyncChanges(
44 const tracked_objects::Location& from_here, 45 const tracked_objects::Location& from_here,
45 const SyncChangeList& change_list) { 46 const csync::SyncChangeList& change_list) {
46 return process_sync_changes_error_; 47 return process_sync_changes_error_;
47 } 48 }
48 49
49 SyncError FakeGenericChangeProcessor::GetSyncDataForType( 50 csync::SyncError FakeGenericChangeProcessor::GetSyncDataForType(
50 syncable::ModelType type, SyncDataList* current_sync_data) { 51 syncable::ModelType type, csync::SyncDataList* current_sync_data) {
51 type_ = type; 52 type_ = type;
52 return get_sync_data_for_type_error_; 53 return get_sync_data_for_type_error_;
53 } 54 }
54 55
55 bool FakeGenericChangeProcessor::SyncModelHasUserCreatedNodes( 56 bool FakeGenericChangeProcessor::SyncModelHasUserCreatedNodes(
56 syncable::ModelType type, bool* has_nodes) { 57 syncable::ModelType type, bool* has_nodes) {
57 type_ = type; 58 type_ = type;
58 *has_nodes = sync_model_has_user_created_nodes_; 59 *has_nodes = sync_model_has_user_created_nodes_;
59 return sync_model_has_user_created_nodes_success_; 60 return sync_model_has_user_created_nodes_success_;
60 } 61 }
61 62
62 bool FakeGenericChangeProcessor::CryptoReadyIfNecessary( 63 bool FakeGenericChangeProcessor::CryptoReadyIfNecessary(
63 syncable::ModelType type) { 64 syncable::ModelType type) {
64 type_ = type; 65 type_ = type;
65 return crypto_ready_if_necessary_; 66 return crypto_ready_if_necessary_;
66 } 67 }
67 68
68 } // namespace browser_sync 69 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/fake_generic_change_processor.h ('k') | chrome/browser/sync/glue/frontend_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698