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

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

Issue 11958029: [Sync] Add support for proxy types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to ProxyTypes Created 7 years, 10 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/proxy_data_type_controller.cc
diff --git a/chrome/browser/sync/glue/proxy_data_type_controller.cc b/chrome/browser/sync/glue/proxy_data_type_controller.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ffe138c0bd39038bf3f8bbcd7fdb9d243b325ba0
--- /dev/null
+++ b/chrome/browser/sync/glue/proxy_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/proxy_data_type_controller.h"
+
+namespace browser_sync {
+
+ProxyDataTypeController::ProxyDataTypeController(syncer::ModelType type)
+ : state_(NOT_RUNNING),
+ type_(type) {
+ DCHECK(syncer::ProxyTypes().Has(type_));
+}
+
+ProxyDataTypeController::~ProxyDataTypeController() {
+}
+
+void ProxyDataTypeController::LoadModels(
+ const ModelLoadCallback& model_load_callback) {
+ state_ = MODEL_LOADED;
+ model_load_callback.Run(type(), syncer::SyncError());
+}
+
+void ProxyDataTypeController::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 ProxyDataTypeController::Stop() {
+ state_ = NOT_RUNNING;
+}
+
+syncer::ModelType ProxyDataTypeController::type() const {
+ DCHECK(syncer::ProxyTypes().Has(type_));
+ return type_;
+}
+
+syncer::ModelSafeGroup ProxyDataTypeController::model_safe_group() const {
+ DCHECK(syncer::ProxyTypes().Has(type_));
+ return syncer::GROUP_PASSIVE;
+}
+
+std::string ProxyDataTypeController::name() const {
+ // For logging only.
+ return syncer::ModelTypeToString(type());
+}
+
+DataTypeController::State ProxyDataTypeController::state() const {
+ return state_;
+}
+
+void ProxyDataTypeController::OnSingleDatatypeUnrecoverableError(
+ const tracked_objects::Location& from_here, const std::string& message) {
+ NOTIMPLEMENTED();
+}
+
+void ProxyDataTypeController::OnModelLoaded() {
+ NOTIMPLEMENTED();
+}
+
+} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/glue/proxy_data_type_controller.h ('k') | chrome/browser/sync/glue/sync_backend_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698