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