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" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( | 106 void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( |
107 ProfileSyncService* pss) { | 107 ProfileSyncService* pss) { |
108 RegisterCommonDataTypes(pss); | 108 RegisterCommonDataTypes(pss); |
109 #if !defined(OS_ANDROID) | 109 #if !defined(OS_ANDROID) |
110 RegisterDesktopDataTypes(pss); | 110 RegisterDesktopDataTypes(pss); |
111 #endif | 111 #endif |
112 } | 112 } |
113 | 113 |
114 void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( | 114 void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( |
115 ProfileSyncService* pss) { | 115 ProfileSyncService* pss) { |
| 116 // Autofill sync is enabled by default. Register unless explicitly |
| 117 // disabled. |
| 118 if (!command_line_->HasSwitch(switches::kDisableSyncAutofill)) { |
| 119 pss->RegisterDataTypeController( |
| 120 new AutofillDataTypeController(this, profile_, pss)); |
| 121 } |
| 122 |
| 123 // Autofill profile sync is enabled by default. Register unless explicitly |
| 124 // disabled. |
| 125 if (!command_line_->HasSwitch(switches::kDisableSyncAutofillProfile)) { |
| 126 pss->RegisterDataTypeController( |
| 127 new AutofillProfileDataTypeController(this, profile_, pss)); |
| 128 } |
| 129 |
116 // Bookmark sync is enabled by default. Register unless explicitly | 130 // Bookmark sync is enabled by default. Register unless explicitly |
117 // disabled. | 131 // disabled. |
118 if (!command_line_->HasSwitch(switches::kDisableSyncBookmarks)) { | 132 if (!command_line_->HasSwitch(switches::kDisableSyncBookmarks)) { |
119 pss->RegisterDataTypeController( | 133 pss->RegisterDataTypeController( |
120 new BookmarkDataTypeController(this, profile_, pss)); | 134 new BookmarkDataTypeController(this, profile_, pss)); |
121 } | 135 } |
122 | 136 |
123 // TypedUrl sync is enabled by default. Register unless explicitly disabled, | 137 // TypedUrl sync is enabled by default. Register unless explicitly disabled, |
124 // or if saving history is disabled. | 138 // or if saving history is disabled. |
125 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && | 139 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && |
(...skipping 27 matching lines...) Expand all Loading... |
153 | 167 |
154 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( | 168 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( |
155 ProfileSyncService* pss) { | 169 ProfileSyncService* pss) { |
156 // App sync is enabled by default. Register unless explicitly | 170 // App sync is enabled by default. Register unless explicitly |
157 // disabled. | 171 // disabled. |
158 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { | 172 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { |
159 pss->RegisterDataTypeController( | 173 pss->RegisterDataTypeController( |
160 new ExtensionDataTypeController(syncer::APPS, this, profile_, pss)); | 174 new ExtensionDataTypeController(syncer::APPS, this, profile_, pss)); |
161 } | 175 } |
162 | 176 |
163 // Autofill sync is enabled by default. Register unless explicitly | |
164 // disabled. | |
165 if (!command_line_->HasSwitch(switches::kDisableSyncAutofill)) { | |
166 pss->RegisterDataTypeController( | |
167 new AutofillDataTypeController(this, profile_, pss)); | |
168 } | |
169 | |
170 // Extension sync is enabled by default. Register unless explicitly | 177 // Extension sync is enabled by default. Register unless explicitly |
171 // disabled. | 178 // disabled. |
172 if (!command_line_->HasSwitch(switches::kDisableSyncExtensions)) { | 179 if (!command_line_->HasSwitch(switches::kDisableSyncExtensions)) { |
173 pss->RegisterDataTypeController( | 180 pss->RegisterDataTypeController( |
174 new ExtensionDataTypeController(syncer::EXTENSIONS, | 181 new ExtensionDataTypeController(syncer::EXTENSIONS, |
175 this, profile_, pss)); | 182 this, profile_, pss)); |
176 } | 183 } |
177 | 184 |
178 // Preference sync is enabled by default. Register unless explicitly | 185 // Preference sync is enabled by default. Register unless explicitly |
179 // disabled. | 186 // disabled. |
(...skipping 26 matching lines...) Expand all Loading... |
206 } | 213 } |
207 | 214 |
208 // App setting sync is enabled by default. Register unless explicitly | 215 // App setting sync is enabled by default. Register unless explicitly |
209 // disabled. | 216 // disabled. |
210 if (!command_line_->HasSwitch(switches::kDisableSyncAppSettings)) { | 217 if (!command_line_->HasSwitch(switches::kDisableSyncAppSettings)) { |
211 pss->RegisterDataTypeController( | 218 pss->RegisterDataTypeController( |
212 new ExtensionSettingDataTypeController( | 219 new ExtensionSettingDataTypeController( |
213 syncer::APP_SETTINGS, this, profile_, pss)); | 220 syncer::APP_SETTINGS, this, profile_, pss)); |
214 } | 221 } |
215 | 222 |
216 if (!command_line_->HasSwitch(switches::kDisableSyncAutofillProfile)) { | |
217 pss->RegisterDataTypeController( | |
218 new AutofillProfileDataTypeController(this, profile_, pss)); | |
219 } | |
220 | |
221 // App notifications sync is enabled by default. Register unless explicitly | 223 // App notifications sync is enabled by default. Register unless explicitly |
222 // disabled. | 224 // disabled. |
223 if (!command_line_->HasSwitch(switches::kDisableSyncAppNotifications)) { | 225 if (!command_line_->HasSwitch(switches::kDisableSyncAppNotifications)) { |
224 pss->RegisterDataTypeController( | 226 pss->RegisterDataTypeController( |
225 new AppNotificationDataTypeController(this, profile_, pss)); | 227 new AppNotificationDataTypeController(this, profile_, pss)); |
226 } | 228 } |
227 | 229 |
228 // Unless it is explicitly disabled, history delete directive sync is | 230 // Unless it is explicitly disabled, history delete directive sync is |
229 // enabled whenever full history sync is enabled. | 231 // enabled whenever full history sync is enabled. |
230 if (command_line_->HasSwitch(switches::kHistoryEnableFullHistorySync) && | 232 if (command_line_->HasSwitch(switches::kHistoryEnableFullHistorySync) && |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 ProfileSyncComponentsFactory::SyncComponents | 394 ProfileSyncComponentsFactory::SyncComponents |
393 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 395 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
394 ProfileSyncService* profile_sync_service, | 396 ProfileSyncService* profile_sync_service, |
395 DataTypeErrorHandler* error_handler) { | 397 DataTypeErrorHandler* error_handler) { |
396 SessionModelAssociator* model_associator = | 398 SessionModelAssociator* model_associator = |
397 new SessionModelAssociator(profile_sync_service, error_handler); | 399 new SessionModelAssociator(profile_sync_service, error_handler); |
398 SessionChangeProcessor* change_processor = | 400 SessionChangeProcessor* change_processor = |
399 new SessionChangeProcessor(error_handler, model_associator); | 401 new SessionChangeProcessor(error_handler, model_associator); |
400 return SyncComponents(model_associator, change_processor); | 402 return SyncComponents(model_associator, change_processor); |
401 } | 403 } |
OLD | NEW |