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

Unified Diff: components/sync/driver/proxy_data_type_controller.cc

Issue 2684533003: [Sync] Register PROXY_TABS with ModelTypeRegistry to include it in enabled types (Closed)
Patch Set: Update comment. Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/proxy_data_type_controller.cc
diff --git a/components/sync/driver/proxy_data_type_controller.cc b/components/sync/driver/proxy_data_type_controller.cc
index 0bc9a7527bce20ac24130ce26a94c7e19ffe3dd4..08d3a953dbaf60ea00b7ae90c61abadde83fc7b3 100644
--- a/components/sync/driver/proxy_data_type_controller.cc
+++ b/components/sync/driver/proxy_data_type_controller.cc
@@ -6,6 +6,8 @@
#include "base/memory/ptr_util.h"
#include "base/values.h"
+#include "components/sync/engine/model_safe_worker.h"
+#include "components/sync/engine/model_type_configurer.h"
#include "components/sync/model/sync_merge_result.h"
namespace syncer {
@@ -22,7 +24,14 @@ bool ProxyDataTypeController::ShouldLoadModelBeforeConfigure() const {
}
void ProxyDataTypeController::BeforeLoadModels(
- ModelTypeConfigurer* configurer) {}
+ ModelTypeConfigurer* configurer) {
+ // Proxy type doesn't need to be registered with ModelTypeRegistry as it
+ // doesn't need update handler, client doesn't expect updates of this type
+ // from the server. We still need to register proxy type because
+ // AddClientConfigParamsToMessage decides the value of tabs_datatype_enabled
+ // based on presence of proxy types in the set of enabled types.
+ configurer->RegisterDirectoryDataType(type(), GROUP_PASSIVE);
+}
void ProxyDataTypeController::LoadModels(
const ModelLoadCallback& model_load_callback) {
@@ -62,7 +71,9 @@ void ProxyDataTypeController::ActivateDataType(
ModelTypeConfigurer* configurer) {}
void ProxyDataTypeController::DeactivateDataType(
- ModelTypeConfigurer* configurer) {}
+ ModelTypeConfigurer* configurer) {
+ configurer->UnregisterDirectoryDataType(type());
+}
void ProxyDataTypeController::GetAllNodes(const AllNodesCallback& callback) {
callback.Run(type(), base::MakeUnique<base::ListValue>());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698