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

Unified 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: Rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/fake_generic_change_processor.cc
diff --git a/chrome/browser/sync/glue/fake_generic_change_processor.cc b/chrome/browser/sync/glue/fake_generic_change_processor.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e66662a93fdd47b8131b982d697e5ba72e4a0865
--- /dev/null
+++ b/chrome/browser/sync/glue/fake_generic_change_processor.cc
@@ -0,0 +1,68 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/sync/glue/fake_generic_change_processor.h"
+
+#include "base/location.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/sync/api/syncable_service.h"
+
+namespace browser_sync {
+
+FakeGenericChangeProcessor::FakeGenericChangeProcessor()
+ : GenericChangeProcessor(NULL, base::WeakPtr<SyncableService>(), NULL),
+ sync_model_has_user_created_nodes_(true),
+ sync_model_has_user_created_nodes_success_(true),
+ crypto_ready_if_necessary_(true),
+ type_(syncable::UNSPECIFIED) {}
+
+FakeGenericChangeProcessor::~FakeGenericChangeProcessor() {}
+
+void FakeGenericChangeProcessor::set_process_sync_changes_error(
+ const SyncError& error) {
+ process_sync_changes_error_ = error;
+}
+void FakeGenericChangeProcessor::set_get_sync_data_for_type_error(
+ const SyncError& error) {
+ get_sync_data_for_type_error_ = error;
+}
+void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes(
+ bool has_nodes) {
+ sync_model_has_user_created_nodes_ = has_nodes;
+}
+void FakeGenericChangeProcessor::set_sync_model_has_user_created_nodes_success(
+ bool success) {
+ sync_model_has_user_created_nodes_success_ = success;
+}
+void FakeGenericChangeProcessor::set_crypto_ready_if_necessary(
+ bool crypto_ready) {
+ crypto_ready_if_necessary_ = crypto_ready;
+}
+
+SyncError FakeGenericChangeProcessor::ProcessSyncChanges(
+ const tracked_objects::Location& from_here,
+ const SyncChangeList& change_list) {
+ return process_sync_changes_error_;
+}
+
+SyncError FakeGenericChangeProcessor::GetSyncDataForType(
+ syncable::ModelType type, SyncDataList* current_sync_data) {
+ type_ = type;
+ return get_sync_data_for_type_error_;
+}
+
+bool FakeGenericChangeProcessor::SyncModelHasUserCreatedNodes(
+ syncable::ModelType type, bool* has_nodes) {
+ type_ = type;
+ *has_nodes = sync_model_has_user_created_nodes_;
+ return sync_model_has_user_created_nodes_success_;
+}
+
+bool FakeGenericChangeProcessor::CryptoReadyIfNecessary(
+ syncable::ModelType type) {
+ type_ = type;
+ return crypto_ready_if_necessary_;
+}
+
+} // namespace browser_sync
« 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