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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
8 #include "chrome/browser/extensions/app_notification_manager.h" 8 #include "chrome/browser/extensions/app_notification_manager.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_system.h" 10 #include "chrome/browser/extensions/extension_system.h"
11 #include "chrome/browser/extensions/extension_system_factory.h" 11 #include "chrome/browser/extensions/extension_system_factory.h"
12 #include "chrome/browser/extensions/settings/settings_frontend.h" 12 #include "chrome/browser/extensions/settings/settings_frontend.h"
13 #include "chrome/browser/history/history.h" 13 #include "chrome/browser/history/history.h"
14 #include "chrome/browser/history/history_service_factory.h" 14 #include "chrome/browser/history/history_service_factory.h"
15 #include "chrome/browser/prefs/pref_model_associator.h" 15 #include "chrome/browser/prefs/pref_model_associator.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/search_engines/template_url_service.h" 17 #include "chrome/browser/search_engines/template_url_service.h"
18 #include "chrome/browser/search_engines/template_url_service_factory.h" 18 #include "chrome/browser/search_engines/template_url_service_factory.h"
19 #include "chrome/browser/signin/signin_manager.h" 19 #include "chrome/browser/signin/signin_manager.h"
20 #include "chrome/browser/signin/signin_manager_factory.h" 20 #include "chrome/browser/signin/signin_manager_factory.h"
21 #include "chrome/browser/spellchecker/spellcheck_factory.h"
22 #include "chrome/browser/spellchecker/spellcheck_service.h"
21 #include "chrome/browser/sync/glue/app_notification_data_type_controller.h" 23 #include "chrome/browser/sync/glue/app_notification_data_type_controller.h"
22 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" 24 #include "chrome/browser/sync/glue/autofill_data_type_controller.h"
23 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" 25 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h"
24 #include "chrome/browser/sync/glue/bookmark_change_processor.h" 26 #include "chrome/browser/sync/glue/bookmark_change_processor.h"
25 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" 27 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h"
26 #include "chrome/browser/sync/glue/bookmark_model_associator.h" 28 #include "chrome/browser/sync/glue/bookmark_model_associator.h"
27 #include "chrome/browser/sync/glue/data_type_manager_impl.h" 29 #include "chrome/browser/sync/glue/data_type_manager_impl.h"
28 #include "chrome/browser/sync/glue/data_type_manager_observer.h" 30 #include "chrome/browser/sync/glue/data_type_manager_observer.h"
29 #include "chrome/browser/sync/glue/extension_data_type_controller.h" 31 #include "chrome/browser/sync/glue/extension_data_type_controller.h"
30 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h" 32 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 217
216 // Unless it is explicitly disabled, history delete directive sync is 218 // Unless it is explicitly disabled, history delete directive sync is
217 // enabled whenever full history sync is enabled. 219 // enabled whenever full history sync is enabled.
218 if (command_line_->HasSwitch(switches::kHistoryEnableFullHistorySync) && 220 if (command_line_->HasSwitch(switches::kHistoryEnableFullHistorySync) &&
219 !command_line_->HasSwitch( 221 !command_line_->HasSwitch(
220 switches::kDisableSyncHistoryDeleteDirectives)) { 222 switches::kDisableSyncHistoryDeleteDirectives)) {
221 pss->RegisterDataTypeController( 223 pss->RegisterDataTypeController(
222 new UIDataTypeController( 224 new UIDataTypeController(
223 syncer::HISTORY_DELETE_DIRECTIVES, this, profile_, pss)); 225 syncer::HISTORY_DELETE_DIRECTIVES, this, profile_, pss));
224 } 226 }
227
228 // Dictionary sync is disabled by default. Register only if explicitly
229 // enabled.
230 if (command_line_->HasSwitch(switches::kEnableSyncDictionary)) {
231 pss->RegisterDataTypeController(
232 new UIDataTypeController(syncer::DICTIONARY, this, profile_, pss));
233 }
225 } 234 }
226 235
227 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager( 236 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager(
228 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& 237 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&
229 debug_info_listener, 238 debug_info_listener,
230 SyncBackendHost* backend, 239 SyncBackendHost* backend,
231 const DataTypeController::TypeMap* controllers, 240 const DataTypeController::TypeMap* controllers,
232 DataTypeManagerObserver* observer) { 241 DataTypeManagerObserver* observer) {
233 return new DataTypeManagerImpl(debug_info_listener, 242 return new DataTypeManagerImpl(debug_info_listener,
234 backend, 243 backend,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 case syncer::THEMES: 298 case syncer::THEMES:
290 return ThemeServiceFactory::GetForProfile(profile_)-> 299 return ThemeServiceFactory::GetForProfile(profile_)->
291 GetThemeSyncableService()->AsWeakPtr(); 300 GetThemeSyncableService()->AsWeakPtr();
292 #endif 301 #endif
293 case syncer::HISTORY_DELETE_DIRECTIVES: { 302 case syncer::HISTORY_DELETE_DIRECTIVES: {
294 HistoryService* history = 303 HistoryService* history =
295 HistoryServiceFactory::GetForProfile( 304 HistoryServiceFactory::GetForProfile(
296 profile_, Profile::EXPLICIT_ACCESS); 305 profile_, Profile::EXPLICIT_ACCESS);
297 return history ? history->AsWeakPtr() : base::WeakPtr<HistoryService>(); 306 return history ? history->AsWeakPtr() : base::WeakPtr<HistoryService>();
298 } 307 }
308 case syncer::DICTIONARY:
309 return SpellcheckServiceFactory::GetForProfile(profile_)->
310 GetCustomDictionary()->AsWeakPtr();
299 default: 311 default:
300 // The following datatypes still need to be transitioned to the 312 // The following datatypes still need to be transitioned to the
301 // syncer::SyncableService API: 313 // syncer::SyncableService API:
302 // Bookmarks 314 // Bookmarks
303 // Passwords 315 // Passwords
304 // Sessions 316 // Sessions
305 // Typed URLs 317 // Typed URLs
306 NOTREACHED(); 318 NOTREACHED();
307 return base::WeakPtr<syncer::SyncableService>(); 319 return base::WeakPtr<syncer::SyncableService>();
308 } 320 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 ProfileSyncComponentsFactory::SyncComponents 380 ProfileSyncComponentsFactory::SyncComponents
369 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( 381 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents(
370 ProfileSyncService* profile_sync_service, 382 ProfileSyncService* profile_sync_service,
371 DataTypeErrorHandler* error_handler) { 383 DataTypeErrorHandler* error_handler) {
372 SessionModelAssociator* model_associator = 384 SessionModelAssociator* model_associator =
373 new SessionModelAssociator(profile_sync_service, error_handler); 385 new SessionModelAssociator(profile_sync_service, error_handler);
374 SessionChangeProcessor* change_processor = 386 SessionChangeProcessor* change_processor =
375 new SessionChangeProcessor(error_handler, model_associator); 387 new SessionChangeProcessor(error_handler, model_associator);
376 return SyncComponents(model_associator, change_processor); 388 return SyncComponents(model_associator, change_processor);
377 } 389 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698