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