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 if (!command_line_->HasSwitch(switches::kDisableSyncAutofillProfile)) { | |
Nicolas Zea
2013/01/29 01:22:23
Comment about this being enabled by default too
cjhopman
2013/02/05 01:47:20
Done.
| |
124 pss->RegisterDataTypeController( | |
125 new AutofillProfileDataTypeController(this, profile_, pss)); | |
126 } | |
127 | |
128 | |
Nicolas Zea
2013/01/29 01:22:23
remove extra newline
cjhopman
2013/02/05 01:47:20
Done.
| |
116 // Bookmark sync is enabled by default. Register unless explicitly | 129 // Bookmark sync is enabled by default. Register unless explicitly |
117 // disabled. | 130 // disabled. |
118 if (!command_line_->HasSwitch(switches::kDisableSyncBookmarks)) { | 131 if (!command_line_->HasSwitch(switches::kDisableSyncBookmarks)) { |
119 pss->RegisterDataTypeController( | 132 pss->RegisterDataTypeController( |
120 new BookmarkDataTypeController(this, profile_, pss)); | 133 new BookmarkDataTypeController(this, profile_, pss)); |
121 } | 134 } |
122 | 135 |
123 // TypedUrl sync is enabled by default. Register unless explicitly disabled, | 136 // TypedUrl sync is enabled by default. Register unless explicitly disabled, |
124 // or if saving history is disabled. | 137 // or if saving history is disabled. |
125 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && | 138 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && |
(...skipping 27 matching lines...) Expand all Loading... | |
153 | 166 |
154 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( | 167 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( |
155 ProfileSyncService* pss) { | 168 ProfileSyncService* pss) { |
156 // App sync is enabled by default. Register unless explicitly | 169 // App sync is enabled by default. Register unless explicitly |
157 // disabled. | 170 // disabled. |
158 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { | 171 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { |
159 pss->RegisterDataTypeController( | 172 pss->RegisterDataTypeController( |
160 new ExtensionDataTypeController(syncer::APPS, this, profile_, pss)); | 173 new ExtensionDataTypeController(syncer::APPS, this, profile_, pss)); |
161 } | 174 } |
162 | 175 |
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 | 176 // Extension sync is enabled by default. Register unless explicitly |
171 // disabled. | 177 // disabled. |
172 if (!command_line_->HasSwitch(switches::kDisableSyncExtensions)) { | 178 if (!command_line_->HasSwitch(switches::kDisableSyncExtensions)) { |
173 pss->RegisterDataTypeController( | 179 pss->RegisterDataTypeController( |
174 new ExtensionDataTypeController(syncer::EXTENSIONS, | 180 new ExtensionDataTypeController(syncer::EXTENSIONS, |
175 this, profile_, pss)); | 181 this, profile_, pss)); |
176 } | 182 } |
177 | 183 |
178 // Preference sync is enabled by default. Register unless explicitly | 184 // Preference sync is enabled by default. Register unless explicitly |
179 // disabled. | 185 // disabled. |
(...skipping 26 matching lines...) Expand all Loading... | |
206 } | 212 } |
207 | 213 |
208 // App setting sync is enabled by default. Register unless explicitly | 214 // App setting sync is enabled by default. Register unless explicitly |
209 // disabled. | 215 // disabled. |
210 if (!command_line_->HasSwitch(switches::kDisableSyncAppSettings)) { | 216 if (!command_line_->HasSwitch(switches::kDisableSyncAppSettings)) { |
211 pss->RegisterDataTypeController( | 217 pss->RegisterDataTypeController( |
212 new ExtensionSettingDataTypeController( | 218 new ExtensionSettingDataTypeController( |
213 syncer::APP_SETTINGS, this, profile_, pss)); | 219 syncer::APP_SETTINGS, this, profile_, pss)); |
214 } | 220 } |
215 | 221 |
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 | 222 // App notifications sync is enabled by default. Register unless explicitly |
222 // disabled. | 223 // disabled. |
223 if (!command_line_->HasSwitch(switches::kDisableSyncAppNotifications)) { | 224 if (!command_line_->HasSwitch(switches::kDisableSyncAppNotifications)) { |
224 pss->RegisterDataTypeController( | 225 pss->RegisterDataTypeController( |
225 new AppNotificationDataTypeController(this, profile_, pss)); | 226 new AppNotificationDataTypeController(this, profile_, pss)); |
226 } | 227 } |
227 | 228 |
228 // Unless it is explicitly disabled, history delete directive sync is | 229 // Unless it is explicitly disabled, history delete directive sync is |
229 // enabled whenever full history sync is enabled. | 230 // enabled whenever full history sync is enabled. |
230 if (command_line_->HasSwitch(switches::kHistoryEnableFullHistorySync) && | 231 if (command_line_->HasSwitch(switches::kHistoryEnableFullHistorySync) && |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 ProfileSyncComponentsFactory::SyncComponents | 391 ProfileSyncComponentsFactory::SyncComponents |
391 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 392 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
392 ProfileSyncService* profile_sync_service, | 393 ProfileSyncService* profile_sync_service, |
393 DataTypeErrorHandler* error_handler) { | 394 DataTypeErrorHandler* error_handler) { |
394 SessionModelAssociator* model_associator = | 395 SessionModelAssociator* model_associator = |
395 new SessionModelAssociator(profile_sync_service, error_handler); | 396 new SessionModelAssociator(profile_sync_service, error_handler); |
396 SessionChangeProcessor* change_processor = | 397 SessionChangeProcessor* change_processor = |
397 new SessionChangeProcessor(error_handler, model_associator); | 398 new SessionChangeProcessor(error_handler, model_associator); |
398 return SyncComponents(model_associator, change_processor); | 399 return SyncComponents(model_associator, change_processor); |
399 } | 400 } |
OLD | NEW |