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(); |
244 #if !defined(OS_ANDROID) | 245 if (!command_line_->HasSwitch(switches::kDisableSyncSyncedNotifications)) { |
245 pss->RegisterDataTypeController( | 246 if (channel == chrome::VersionInfo::CHANNEL_UNKNOWN || |
246 new UIDataTypeController( | 247 channel == chrome::VersionInfo::CHANNEL_CANARY || |
247 syncer::SYNCED_NOTIFICATIONS, this, profile_, pss)); | 248 channel == chrome::VersionInfo::CHANNEL_DEV) { |
248 #endif | 249 pss->RegisterDataTypeController( |
| 250 new UIDataTypeController( |
| 251 syncer::SYNCED_NOTIFICATIONS, this, profile_, pss)); |
| 252 } |
249 } | 253 } |
250 | 254 |
251 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS) | 255 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS) |
252 // Dictionary sync is enabled by default. | 256 // Dictionary sync is enabled by default. |
253 if (!command_line_->HasSwitch(switches::kDisableSyncDictionary)) { | 257 if (!command_line_->HasSwitch(switches::kDisableSyncDictionary)) { |
254 pss->RegisterDataTypeController( | 258 pss->RegisterDataTypeController( |
255 new UIDataTypeController(syncer::DICTIONARY, this, profile_, pss)); | 259 new UIDataTypeController(syncer::DICTIONARY, this, profile_, pss)); |
256 } | 260 } |
257 #endif | 261 #endif |
258 | 262 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 ProfileSyncComponentsFactory::SyncComponents | 422 ProfileSyncComponentsFactory::SyncComponents |
419 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 423 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
420 ProfileSyncService* profile_sync_service, | 424 ProfileSyncService* profile_sync_service, |
421 DataTypeErrorHandler* error_handler) { | 425 DataTypeErrorHandler* error_handler) { |
422 SessionModelAssociator* model_associator = | 426 SessionModelAssociator* model_associator = |
423 new SessionModelAssociator(profile_sync_service, error_handler); | 427 new SessionModelAssociator(profile_sync_service, error_handler); |
424 SessionChangeProcessor* change_processor = | 428 SessionChangeProcessor* change_processor = |
425 new SessionChangeProcessor(error_handler, model_associator); | 429 new SessionChangeProcessor(error_handler, model_associator); |
426 return SyncComponents(model_associator, change_processor); | 430 return SyncComponents(model_associator, change_processor); |
427 } | 431 } |
OLD | NEW |