OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/extensions/app_notification_manager.h" | 6 #include "chrome/browser/extensions/app_notification_manager.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/settings/settings_backend.h" | 8 #include "chrome/browser/extensions/settings/settings_backend.h" |
9 #include "chrome/browser/prefs/pref_model_associator.h" | 9 #include "chrome/browser/prefs/pref_model_associator.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 146 } |
147 | 147 |
148 // TypedUrl sync is enabled by default. Register unless explicitly disabled, | 148 // TypedUrl sync is enabled by default. Register unless explicitly disabled, |
149 // or if saving history is disabled. | 149 // or if saving history is disabled. |
150 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && | 150 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && |
151 !command_line_->HasSwitch(switches::kDisableSyncTypedUrls)) { | 151 !command_line_->HasSwitch(switches::kDisableSyncTypedUrls)) { |
152 pss->RegisterDataTypeController( | 152 pss->RegisterDataTypeController( |
153 new TypedUrlDataTypeController(this, profile_)); | 153 new TypedUrlDataTypeController(this, profile_)); |
154 } | 154 } |
155 | 155 |
| 156 // Search Engine sync is enabled by default. Register only if explicitly |
| 157 // disabled. |
| 158 if (!command_line_->HasSwitch(switches::kDisableSyncSearchEngines)) { |
| 159 pss->RegisterDataTypeController( |
| 160 new SearchEngineDataTypeController(this, profile_, pss)); |
| 161 } |
| 162 |
156 // Session sync is disabled by default. Register only if explicitly | 163 // Session sync is disabled by default. Register only if explicitly |
157 // enabled. | 164 // enabled. |
158 if (command_line_->HasSwitch(switches::kEnableSyncTabs)) { | 165 if (command_line_->HasSwitch(switches::kEnableSyncTabs)) { |
159 pss->RegisterDataTypeController( | 166 pss->RegisterDataTypeController( |
160 new SessionDataTypeController(this, profile_, pss)); | 167 new SessionDataTypeController(this, profile_, pss)); |
161 } | 168 } |
162 | 169 |
163 // Extension setting sync is disabled by default. Register only if | 170 // Extension setting sync is disabled by default. Register only if |
164 // explicitly enabled. | 171 // explicitly enabled. |
165 if (command_line_->HasSwitch(switches::kEnableSyncExtensionSettings)) { | 172 if (command_line_->HasSwitch(switches::kEnableSyncExtensionSettings)) { |
166 pss->RegisterDataTypeController( | 173 pss->RegisterDataTypeController( |
167 new ExtensionSettingDataTypeController( | 174 new ExtensionSettingDataTypeController( |
168 syncable::EXTENSION_SETTINGS, this, profile_, pss)); | 175 syncable::EXTENSION_SETTINGS, this, profile_, pss)); |
169 pss->RegisterDataTypeController( | 176 pss->RegisterDataTypeController( |
170 new ExtensionSettingDataTypeController( | 177 new ExtensionSettingDataTypeController( |
171 syncable::APP_SETTINGS, this, profile_, pss)); | 178 syncable::APP_SETTINGS, this, profile_, pss)); |
172 } | 179 } |
173 | 180 |
174 if (!command_line_->HasSwitch(switches::kDisableSyncAutofillProfile)) { | 181 if (!command_line_->HasSwitch(switches::kDisableSyncAutofillProfile)) { |
175 pss->RegisterDataTypeController( | 182 pss->RegisterDataTypeController( |
176 new AutofillProfileDataTypeController(this, profile_)); | 183 new AutofillProfileDataTypeController(this, profile_)); |
177 } | 184 } |
178 | 185 |
179 // Search Engine sync is disabled by default. Register only if explicitly | |
180 // enabled. | |
181 if (command_line_->HasSwitch(switches::kEnableSyncSearchEngines)) { | |
182 pss->RegisterDataTypeController( | |
183 new SearchEngineDataTypeController(this, profile_, pss)); | |
184 } | |
185 | |
186 // App notifications sync is disabled by default. Register only if | 186 // App notifications sync is disabled by default. Register only if |
187 // explicitly enabled. | 187 // explicitly enabled. |
188 if (command_line_->HasSwitch(switches::kEnableSyncAppNotifications)) { | 188 if (command_line_->HasSwitch(switches::kEnableSyncAppNotifications)) { |
189 pss->RegisterDataTypeController( | 189 pss->RegisterDataTypeController( |
190 new AppNotificationDataTypeController(this, profile_, pss)); | 190 new AppNotificationDataTypeController(this, profile_, pss)); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 DataTypeManager* ProfileSyncFactoryImpl::CreateDataTypeManager( | 194 DataTypeManager* ProfileSyncFactoryImpl::CreateDataTypeManager( |
195 SyncBackendHost* backend, | 195 SyncBackendHost* backend, |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 GenericChangeProcessor* change_processor = | 398 GenericChangeProcessor* change_processor = |
399 new GenericChangeProcessor(error_handler, | 399 new GenericChangeProcessor(error_handler, |
400 notif_sync_service, | 400 notif_sync_service, |
401 user_share); | 401 user_share); |
402 SyncableServiceAdapter* sync_service_adapter = | 402 SyncableServiceAdapter* sync_service_adapter = |
403 new SyncableServiceAdapter(syncable::APP_NOTIFICATIONS, | 403 new SyncableServiceAdapter(syncable::APP_NOTIFICATIONS, |
404 notif_sync_service, | 404 notif_sync_service, |
405 change_processor); | 405 change_processor); |
406 return SyncComponents(sync_service_adapter, change_processor); | 406 return SyncComponents(sync_service_adapter, change_processor); |
407 } | 407 } |
OLD | NEW |