| 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/extensions/app_notification_manager.h" | 7 #include "chrome/browser/extensions/app_notification_manager.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/settings/settings_frontend.h" | 9 #include "chrome/browser/extensions/settings/settings_frontend.h" |
| 10 #include "chrome/browser/prefs/pref_model_associator.h" | 10 #include "chrome/browser/prefs/pref_model_associator.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 new PasswordDataTypeController(this, profile_, pss)); | 124 new PasswordDataTypeController(this, profile_, pss)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 // Preference sync is enabled by default. Register unless explicitly | 127 // Preference sync is enabled by default. Register unless explicitly |
| 128 // disabled. | 128 // disabled. |
| 129 if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { | 129 if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { |
| 130 pss->RegisterDataTypeController( | 130 pss->RegisterDataTypeController( |
| 131 new UIDataTypeController(syncable::PREFERENCES, this, profile_, pss)); | 131 new UIDataTypeController(syncable::PREFERENCES, this, profile_, pss)); |
| 132 } | 132 } |
| 133 | 133 |
| 134 #if defined(ENABLE_THEMES) |
| 134 // Theme sync is enabled by default. Register unless explicitly disabled. | 135 // Theme sync is enabled by default. Register unless explicitly disabled. |
| 135 if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { | 136 if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { |
| 136 pss->RegisterDataTypeController( | 137 pss->RegisterDataTypeController( |
| 137 new ThemeDataTypeController(this, profile_, pss)); | 138 new ThemeDataTypeController(this, profile_, pss)); |
| 138 } | 139 } |
| 140 #endif |
| 139 | 141 |
| 140 // TypedUrl sync is enabled by default. Register unless explicitly disabled, | 142 // TypedUrl sync is enabled by default. Register unless explicitly disabled, |
| 141 // or if saving history is disabled. | 143 // or if saving history is disabled. |
| 142 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && | 144 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && |
| 143 !command_line_->HasSwitch(switches::kDisableSyncTypedUrls)) { | 145 !command_line_->HasSwitch(switches::kDisableSyncTypedUrls)) { |
| 144 pss->RegisterDataTypeController( | 146 pss->RegisterDataTypeController( |
| 145 new TypedUrlDataTypeController(this, profile_, pss)); | 147 new TypedUrlDataTypeController(this, profile_, pss)); |
| 146 } | 148 } |
| 147 | 149 |
| 148 // Search Engine sync is enabled by default. Register only if explicitly | 150 // Search Engine sync is enabled by default. Register only if explicitly |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 PasswordModelAssociator* model_associator = | 289 PasswordModelAssociator* model_associator = |
| 288 new PasswordModelAssociator(profile_sync_service, | 290 new PasswordModelAssociator(profile_sync_service, |
| 289 password_store); | 291 password_store); |
| 290 PasswordChangeProcessor* change_processor = | 292 PasswordChangeProcessor* change_processor = |
| 291 new PasswordChangeProcessor(model_associator, | 293 new PasswordChangeProcessor(model_associator, |
| 292 password_store, | 294 password_store, |
| 293 error_handler); | 295 error_handler); |
| 294 return SyncComponents(model_associator, change_processor); | 296 return SyncComponents(model_associator, change_processor); |
| 295 } | 297 } |
| 296 | 298 |
| 299 #if defined(ENABLE_THEMES) |
| 297 ProfileSyncComponentsFactory::SyncComponents | 300 ProfileSyncComponentsFactory::SyncComponents |
| 298 ProfileSyncComponentsFactoryImpl::CreateThemeSyncComponents( | 301 ProfileSyncComponentsFactoryImpl::CreateThemeSyncComponents( |
| 299 ProfileSyncService* profile_sync_service, | 302 ProfileSyncService* profile_sync_service, |
| 300 DataTypeErrorHandler* error_handler) { | 303 DataTypeErrorHandler* error_handler) { |
| 301 ThemeModelAssociator* model_associator = | 304 ThemeModelAssociator* model_associator = |
| 302 new ThemeModelAssociator(profile_sync_service); | 305 new ThemeModelAssociator(profile_sync_service); |
| 303 ThemeChangeProcessor* change_processor = | 306 ThemeChangeProcessor* change_processor = |
| 304 new ThemeChangeProcessor(error_handler); | 307 new ThemeChangeProcessor(error_handler); |
| 305 return SyncComponents(model_associator, change_processor); | 308 return SyncComponents(model_associator, change_processor); |
| 306 } | 309 } |
| 310 #endif |
| 307 | 311 |
| 308 ProfileSyncComponentsFactory::SyncComponents | 312 ProfileSyncComponentsFactory::SyncComponents |
| 309 ProfileSyncComponentsFactoryImpl::CreateTypedUrlSyncComponents( | 313 ProfileSyncComponentsFactoryImpl::CreateTypedUrlSyncComponents( |
| 310 ProfileSyncService* profile_sync_service, | 314 ProfileSyncService* profile_sync_service, |
| 311 history::HistoryBackend* history_backend, | 315 history::HistoryBackend* history_backend, |
| 312 browser_sync::DataTypeErrorHandler* error_handler) { | 316 browser_sync::DataTypeErrorHandler* error_handler) { |
| 313 TypedUrlModelAssociator* model_associator = | 317 TypedUrlModelAssociator* model_associator = |
| 314 new TypedUrlModelAssociator(profile_sync_service, | 318 new TypedUrlModelAssociator(profile_sync_service, |
| 315 history_backend); | 319 history_backend); |
| 316 TypedUrlChangeProcessor* change_processor = | 320 TypedUrlChangeProcessor* change_processor = |
| 317 new TypedUrlChangeProcessor(profile_, | 321 new TypedUrlChangeProcessor(profile_, |
| 318 model_associator, | 322 model_associator, |
| 319 history_backend, | 323 history_backend, |
| 320 error_handler); | 324 error_handler); |
| 321 return SyncComponents(model_associator, change_processor); | 325 return SyncComponents(model_associator, change_processor); |
| 322 } | 326 } |
| 323 | 327 |
| 324 ProfileSyncComponentsFactory::SyncComponents | 328 ProfileSyncComponentsFactory::SyncComponents |
| 325 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 329 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
| 326 ProfileSyncService* profile_sync_service, | 330 ProfileSyncService* profile_sync_service, |
| 327 DataTypeErrorHandler* error_handler) { | 331 DataTypeErrorHandler* error_handler) { |
| 328 SessionModelAssociator* model_associator = | 332 SessionModelAssociator* model_associator = |
| 329 new SessionModelAssociator(profile_sync_service); | 333 new SessionModelAssociator(profile_sync_service); |
| 330 SessionChangeProcessor* change_processor = | 334 SessionChangeProcessor* change_processor = |
| 331 new SessionChangeProcessor(error_handler, model_associator); | 335 new SessionChangeProcessor(error_handler, model_associator); |
| 332 return SyncComponents(model_associator, change_processor); | 336 return SyncComponents(model_associator, change_processor); |
| 333 } | 337 } |
| OLD | NEW |