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

Unified Diff: chrome/browser/sync/glue/virtual_data_type_controller.cc

Issue 11958029: [Sync] Add support for proxy types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments and rename local -> virtual Created 7 years, 11 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/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

Powered by Google App Engine
This is Rietveld 408576698