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/notifier/chrome_notifier_service.h" | |
16 #include "chrome/browser/notifier/chrome_notifier_service_factory.h" | |
15 #include "chrome/browser/prefs/pref_model_associator.h" | 17 #include "chrome/browser/prefs/pref_model_associator.h" |
16 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
17 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/search_engines/template_url_service.h" | 20 #include "chrome/browser/search_engines/template_url_service.h" |
19 #include "chrome/browser/search_engines/template_url_service_factory.h" | 21 #include "chrome/browser/search_engines/template_url_service_factory.h" |
20 #include "chrome/browser/signin/signin_manager.h" | 22 #include "chrome/browser/signin/signin_manager.h" |
21 #include "chrome/browser/signin/signin_manager_factory.h" | 23 #include "chrome/browser/signin/signin_manager_factory.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" |
(...skipping 191 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 // Synced Notifications sync is enabled by default. Register unless | |
Nicolas Zea
2013/01/29 01:17:02
I don't think this should be enabled by default. T
Pete Williamson
2013/01/29 02:10:37
Done.
| |
230 // explicitly disabled. | |
231 if (!command_line_->HasSwitch(switches::kDisableSyncSyncedNotifications)) { | |
232 pss->RegisterDataTypeController( | |
233 new UIDataTypeController( | |
234 syncer::SYNCED_NOTIFICATIONS, this, profile_, pss)); | |
235 } | |
226 } | 236 } |
227 | 237 |
228 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager( | 238 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager( |
229 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& | 239 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& |
230 debug_info_listener, | 240 debug_info_listener, |
231 SyncBackendHost* backend, | 241 SyncBackendHost* backend, |
232 const DataTypeController::TypeMap* controllers, | 242 const DataTypeController::TypeMap* controllers, |
233 DataTypeManagerObserver* observer) { | 243 DataTypeManagerObserver* observer) { |
234 return new DataTypeManagerImpl(debug_info_listener, | 244 return new DataTypeManagerImpl(debug_info_listener, |
235 backend, | 245 backend, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 case syncer::THEMES: | 300 case syncer::THEMES: |
291 return ThemeServiceFactory::GetForProfile(profile_)-> | 301 return ThemeServiceFactory::GetForProfile(profile_)-> |
292 GetThemeSyncableService()->AsWeakPtr(); | 302 GetThemeSyncableService()->AsWeakPtr(); |
293 #endif | 303 #endif |
294 case syncer::HISTORY_DELETE_DIRECTIVES: { | 304 case syncer::HISTORY_DELETE_DIRECTIVES: { |
295 HistoryService* history = | 305 HistoryService* history = |
296 HistoryServiceFactory::GetForProfile( | 306 HistoryServiceFactory::GetForProfile( |
297 profile_, Profile::EXPLICIT_ACCESS); | 307 profile_, Profile::EXPLICIT_ACCESS); |
298 return history ? history->AsWeakPtr() : base::WeakPtr<HistoryService>(); | 308 return history ? history->AsWeakPtr() : base::WeakPtr<HistoryService>(); |
299 } | 309 } |
310 | |
311 case syncer::SYNCED_NOTIFICATIONS: { | |
312 notifier::ChromeNotifierService* notifier_service = | |
313 notifier::ChromeNotifierServiceFactory::GetForProfile( | |
314 profile_, Profile::EXPLICIT_ACCESS); | |
315 return notifier_service ? notifier_service->AsWeakPtr() | |
316 : base::WeakPtr<notifier::ChromeNotifierService>(); | |
317 } | |
318 | |
300 default: | 319 default: |
301 // The following datatypes still need to be transitioned to the | 320 // The following datatypes still need to be transitioned to the |
302 // syncer::SyncableService API: | 321 // syncer::SyncableService API: |
303 // Bookmarks | 322 // Bookmarks |
304 // Passwords | 323 // Passwords |
305 // Sessions | 324 // Sessions |
306 // Typed URLs | 325 // Typed URLs |
307 NOTREACHED(); | 326 NOTREACHED(); |
308 return base::WeakPtr<syncer::SyncableService>(); | 327 return base::WeakPtr<syncer::SyncableService>(); |
309 } | 328 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 ProfileSyncComponentsFactory::SyncComponents | 388 ProfileSyncComponentsFactory::SyncComponents |
370 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 389 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
371 ProfileSyncService* profile_sync_service, | 390 ProfileSyncService* profile_sync_service, |
372 DataTypeErrorHandler* error_handler) { | 391 DataTypeErrorHandler* error_handler) { |
373 SessionModelAssociator* model_associator = | 392 SessionModelAssociator* model_associator = |
374 new SessionModelAssociator(profile_sync_service, error_handler); | 393 new SessionModelAssociator(profile_sync_service, error_handler); |
375 SessionChangeProcessor* change_processor = | 394 SessionChangeProcessor* change_processor = |
376 new SessionChangeProcessor(error_handler, model_associator); | 395 new SessionChangeProcessor(error_handler, model_associator); |
377 return SyncComponents(model_associator, change_processor); | 396 return SyncComponents(model_associator, change_processor); |
378 } | 397 } |
OLD | NEW |