| 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/api/webdata/autofill_web_data_service.h" | 7 #include "chrome/browser/api/webdata/autofill_web_data_service.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 9 #include "chrome/browser/extensions/api/storage/settings_frontend.h" | 9 #include "chrome/browser/extensions/api/storage/settings_frontend.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "chrome/browser/sync/glue/ui_data_type_controller.h" | 52 #include "chrome/browser/sync/glue/ui_data_type_controller.h" |
| 53 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" | 53 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" |
| 54 #include "chrome/browser/sync/profile_sync_service.h" | 54 #include "chrome/browser/sync/profile_sync_service.h" |
| 55 #include "chrome/browser/sync/profile_sync_service_factory.h" | 55 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 56 #include "chrome/browser/themes/theme_service.h" | 56 #include "chrome/browser/themes/theme_service.h" |
| 57 #include "chrome/browser/themes/theme_service_factory.h" | 57 #include "chrome/browser/themes/theme_service_factory.h" |
| 58 #include "chrome/browser/themes/theme_syncable_service.h" | 58 #include "chrome/browser/themes/theme_syncable_service.h" |
| 59 #include "chrome/browser/webdata/autocomplete_syncable_service.h" | 59 #include "chrome/browser/webdata/autocomplete_syncable_service.h" |
| 60 #include "chrome/browser/webdata/autofill_profile_syncable_service.h" | 60 #include "chrome/browser/webdata/autofill_profile_syncable_service.h" |
| 61 #include "chrome/common/chrome_switches.h" | 61 #include "chrome/common/chrome_switches.h" |
| 62 #include "chrome/common/chrome_version_info.h" | |
| 63 #include "chrome/common/pref_names.h" | 62 #include "chrome/common/pref_names.h" |
| 64 #include "content/public/browser/browser_thread.h" | 63 #include "content/public/browser/browser_thread.h" |
| 65 #include "sync/api/syncable_service.h" | 64 #include "sync/api/syncable_service.h" |
| 66 | 65 |
| 67 using browser_sync::AutofillDataTypeController; | 66 using browser_sync::AutofillDataTypeController; |
| 68 using browser_sync::AutofillProfileDataTypeController; | 67 using browser_sync::AutofillProfileDataTypeController; |
| 69 using browser_sync::BookmarkChangeProcessor; | 68 using browser_sync::BookmarkChangeProcessor; |
| 70 using browser_sync::BookmarkDataTypeController; | 69 using browser_sync::BookmarkDataTypeController; |
| 71 using browser_sync::BookmarkModelAssociator; | 70 using browser_sync::BookmarkModelAssociator; |
| 72 using browser_sync::DataTypeController; | 71 using browser_sync::DataTypeController; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // App setting sync is enabled by default. Register unless explicitly | 233 // App setting sync is enabled by default. Register unless explicitly |
| 235 // disabled. | 234 // disabled. |
| 236 if (!command_line_->HasSwitch(switches::kDisableSyncAppSettings)) { | 235 if (!command_line_->HasSwitch(switches::kDisableSyncAppSettings)) { |
| 237 pss->RegisterDataTypeController( | 236 pss->RegisterDataTypeController( |
| 238 new ExtensionSettingDataTypeController( | 237 new ExtensionSettingDataTypeController( |
| 239 syncer::APP_SETTINGS, this, profile_, pss)); | 238 syncer::APP_SETTINGS, this, profile_, pss)); |
| 240 } | 239 } |
| 241 | 240 |
| 242 // Synced Notifications sync is disabled by default. | 241 // Synced Notifications sync is disabled by default. |
| 243 // TODO(petewil): Switch to enabled by default once datatype support is done. | 242 // TODO(petewil): Switch to enabled by default once datatype support is done. |
| 244 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 243 if (command_line_->HasSwitch(switches::kEnableSyncSyncedNotifications)) { |
| 245 if (!command_line_->HasSwitch(switches::kDisableSyncSyncedNotifications)) { | 244 #if !defined(OS_ANDROID) |
| 246 if (channel == chrome::VersionInfo::CHANNEL_UNKNOWN || | 245 pss->RegisterDataTypeController( |
| 247 channel == chrome::VersionInfo::CHANNEL_CANARY || | 246 new UIDataTypeController( |
| 248 channel == chrome::VersionInfo::CHANNEL_DEV) { | 247 syncer::SYNCED_NOTIFICATIONS, this, profile_, pss)); |
| 249 pss->RegisterDataTypeController( | 248 #endif |
| 250 new UIDataTypeController( | |
| 251 syncer::SYNCED_NOTIFICATIONS, this, profile_, pss)); | |
| 252 } | |
| 253 } | 249 } |
| 254 | 250 |
| 255 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS) | 251 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS) |
| 256 // Dictionary sync is enabled by default. | 252 // Dictionary sync is enabled by default. |
| 257 if (!command_line_->HasSwitch(switches::kDisableSyncDictionary)) { | 253 if (!command_line_->HasSwitch(switches::kDisableSyncDictionary)) { |
| 258 pss->RegisterDataTypeController( | 254 pss->RegisterDataTypeController( |
| 259 new UIDataTypeController(syncer::DICTIONARY, this, profile_, pss)); | 255 new UIDataTypeController(syncer::DICTIONARY, this, profile_, pss)); |
| 260 } | 256 } |
| 261 #endif | 257 #endif |
| 262 | 258 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 ProfileSyncComponentsFactory::SyncComponents | 419 ProfileSyncComponentsFactory::SyncComponents |
| 424 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 420 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
| 425 ProfileSyncService* profile_sync_service, | 421 ProfileSyncService* profile_sync_service, |
| 426 DataTypeErrorHandler* error_handler) { | 422 DataTypeErrorHandler* error_handler) { |
| 427 SessionModelAssociator* model_associator = | 423 SessionModelAssociator* model_associator = |
| 428 new SessionModelAssociator(profile_sync_service, error_handler); | 424 new SessionModelAssociator(profile_sync_service, error_handler); |
| 429 SessionChangeProcessor* change_processor = | 425 SessionChangeProcessor* change_processor = |
| 430 new SessionChangeProcessor(error_handler, model_associator); | 426 new SessionChangeProcessor(error_handler, model_associator); |
| 431 return SyncComponents(model_associator, change_processor); | 427 return SyncComponents(model_associator, change_processor); |
| 432 } | 428 } |
| OLD | NEW |