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

Unified Diff: chrome/browser/sync/profile_sync_components_factory_impl.cc

Issue 11445002: Sync user's custom spellcheck dictionary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add browser tests for dictionary change notifications in settings Created 8 years 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/profile_sync_components_factory_impl.cc
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc
index a9d9a5251fe81ffaaae99262bf03232fe5180af0..a0adb7dabd0d26d62654e812d906b156d3fdb700 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -19,6 +19,8 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/spellchecker/spellcheck_factory.h"
+#include "chrome/browser/spellchecker/spellcheck_service.h"
#include "chrome/browser/sync/glue/app_notification_data_type_controller.h"
#include "chrome/browser/sync/glue/autofill_data_type_controller.h"
#include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h"
@@ -223,6 +225,13 @@ void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes(
new UIDataTypeController(
syncer::HISTORY_DELETE_DIRECTIVES, this, profile_, pss));
}
+
+ // Dictionary sync is disabled by default. Register only if explicitly
+ // enabled.
+ if (command_line_->HasSwitch(switches::kEnableSyncDictionary)) {
+ pss->RegisterDataTypeController(
+ new UIDataTypeController(syncer::DICTIONARY, this, profile_, pss));
+ }
}
DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager(
@@ -297,6 +306,9 @@ base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl::
profile_, Profile::EXPLICIT_ACCESS);
return history ? history->AsWeakPtr() : base::WeakPtr<HistoryService>();
}
+ case syncer::DICTIONARY:
+ return SpellcheckServiceFactory::GetForProfile(profile_)->
+ GetCustomDictionary()->AsWeakPtr();
default:
// The following datatypes still need to be transitioned to the
// syncer::SyncableService API:

Powered by Google App Engine
This is Rietveld 408576698