Index: chrome/browser/sync/glue/virtual_data_type_controller.cc |
diff --git a/chrome/browser/sync/glue/virtual_data_type_controller.cc b/chrome/browser/sync/glue/virtual_data_type_controller.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6c28c124f7c74358b868db94ebcdcdbb8701be0e |
--- /dev/null |
+++ b/chrome/browser/sync/glue/virtual_data_type_controller.cc |
@@ -0,0 +1,66 @@ |
+// Copyright (c) 2013 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/virtual_data_type_controller.h" |
+ |
+namespace browser_sync { |
+ |
+VirtualDataTypeController::VirtualDataTypeController(syncer::ModelType type) |
+ : state_(NOT_RUNNING), |
+ type_(type) { |
+ DCHECK(syncer::VirtualTypes().Has(type_)); |
+} |
+ |
+VirtualDataTypeController::~VirtualDataTypeController() { |
+} |
+ |
+void VirtualDataTypeController::LoadModels( |
+ const ModelLoadCallback& model_load_callback) { |
+ state_ = MODEL_LOADED; |
+ model_load_callback.Run(type(), syncer::SyncError()); |
+} |
+ |
+void VirtualDataTypeController::StartAssociating( |
+ const StartCallback& start_callback) { |
+ syncer::SyncMergeResult local_merge_result(type_); |
+ syncer::SyncMergeResult syncer_merge_result(type_); |
+ state_ = RUNNING; |
+ start_callback.Run(DataTypeController::OK, |
+ local_merge_result, |
+ syncer_merge_result); |
+} |
+ |
+void VirtualDataTypeController::Stop() { |
+ state_ = NOT_RUNNING; |
+} |
+ |
+syncer::ModelType VirtualDataTypeController::type() const { |
+ DCHECK(syncer::VirtualTypes().Has(type_)); |
+ return type_; |
+} |
+ |
+syncer::ModelSafeGroup VirtualDataTypeController::model_safe_group() const { |
+ DCHECK(syncer::VirtualTypes().Has(type_)); |
+ return syncer::GROUP_PASSIVE; |
+} |
+ |
+std::string VirtualDataTypeController::name() const { |
+ // For logging only. |
+ return syncer::ModelTypeToString(type()); |
+} |
+ |
+DataTypeController::State VirtualDataTypeController::state() const { |
+ return state_; |
+} |
+ |
+void VirtualDataTypeController::OnSingleDatatypeUnrecoverableError( |
+ const tracked_objects::Location& from_here, const std::string& message) { |
+ NOTIMPLEMENTED(); |
+} |
+ |
+void VirtualDataTypeController::OnModelLoaded() { |
+ NOTIMPLEMENTED(); |
+} |
+ |
+} // namespace browser_sync |