| 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 "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/defaults.h" | 9 #include "chrome/browser/defaults.h" |
| 10 #include "chrome/browser/prefs/pref_model_associator.h" | 10 #include "chrome/browser/prefs/pref_model_associator.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // disabled. | 114 // disabled. |
| 115 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { | 115 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { |
| 116 pss->RegisterDataTypeController( | 116 pss->RegisterDataTypeController( |
| 117 new AppDataTypeController(this, profile_, pss)); | 117 new AppDataTypeController(this, profile_, pss)); |
| 118 } | 118 } |
| 119 | 119 |
| 120 // Autofill sync is enabled by default. Register unless explicitly | 120 // Autofill sync is enabled by default. Register unless explicitly |
| 121 // disabled. | 121 // disabled. |
| 122 if (!command_line_->HasSwitch(switches::kDisableSyncAutofill)) { | 122 if (!command_line_->HasSwitch(switches::kDisableSyncAutofill)) { |
| 123 pss->RegisterDataTypeController( | 123 pss->RegisterDataTypeController( |
| 124 new AutofillDataTypeController(this, profile_)); | 124 new AutofillDataTypeController(this, profile_, pss)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 // Bookmark sync is enabled by default. Register unless explicitly | 127 // Bookmark sync is enabled by default. Register unless explicitly |
| 128 // disabled. | 128 // disabled. |
| 129 if (!command_line_->HasSwitch(switches::kDisableSyncBookmarks)) { | 129 if (!command_line_->HasSwitch(switches::kDisableSyncBookmarks)) { |
| 130 pss->RegisterDataTypeController( | 130 pss->RegisterDataTypeController( |
| 131 new BookmarkDataTypeController(this, profile_, pss)); | 131 new BookmarkDataTypeController(this, profile_, pss)); |
| 132 } | 132 } |
| 133 | 133 |
| 134 // Extension sync is enabled by default. Register unless explicitly | 134 // Extension sync is enabled by default. Register unless explicitly |
| 135 // disabled. | 135 // disabled. |
| 136 if (!command_line_->HasSwitch(switches::kDisableSyncExtensions)) { | 136 if (!command_line_->HasSwitch(switches::kDisableSyncExtensions)) { |
| 137 pss->RegisterDataTypeController( | 137 pss->RegisterDataTypeController( |
| 138 new ExtensionDataTypeController(this, profile_, pss)); | 138 new ExtensionDataTypeController(this, profile_, pss)); |
| 139 } | 139 } |
| 140 | 140 |
| 141 // Password sync is enabled by default. Register unless explicitly | 141 // Password sync is enabled by default. Register unless explicitly |
| 142 // disabled. | 142 // disabled. |
| 143 if (!command_line_->HasSwitch(switches::kDisableSyncPasswords)) { | 143 if (!command_line_->HasSwitch(switches::kDisableSyncPasswords)) { |
| 144 pss->RegisterDataTypeController( | 144 pss->RegisterDataTypeController( |
| 145 new PasswordDataTypeController(this, profile_)); | 145 new PasswordDataTypeController(this, profile_, pss)); |
| 146 } | 146 } |
| 147 | 147 |
| 148 // Preference sync is enabled by default. Register unless explicitly | 148 // Preference sync is enabled by default. Register unless explicitly |
| 149 // disabled. | 149 // disabled. |
| 150 if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { | 150 if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { |
| 151 pss->RegisterDataTypeController( | 151 pss->RegisterDataTypeController( |
| 152 new PreferenceDataTypeController(this, profile_, pss)); | 152 new PreferenceDataTypeController(this, profile_, pss)); |
| 153 } | 153 } |
| 154 | 154 |
| 155 // Theme sync is enabled by default. Register unless explicitly disabled. | 155 // Theme sync is enabled by default. Register unless explicitly disabled. |
| 156 if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { | 156 if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { |
| 157 pss->RegisterDataTypeController( | 157 pss->RegisterDataTypeController( |
| 158 new ThemeDataTypeController(this, profile_, pss)); | 158 new ThemeDataTypeController(this, profile_, pss)); |
| 159 } | 159 } |
| 160 | 160 |
| 161 // TypedUrl sync is enabled by default. Register unless explicitly disabled, | 161 // TypedUrl sync is enabled by default. Register unless explicitly disabled, |
| 162 // or if saving history is disabled. | 162 // or if saving history is disabled. |
| 163 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && | 163 if (!profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled) && |
| 164 !command_line_->HasSwitch(switches::kDisableSyncTypedUrls)) { | 164 !command_line_->HasSwitch(switches::kDisableSyncTypedUrls)) { |
| 165 pss->RegisterDataTypeController( | 165 pss->RegisterDataTypeController( |
| 166 new TypedUrlDataTypeController(this, profile_)); | 166 new TypedUrlDataTypeController(this, profile_, pss)); |
| 167 } | 167 } |
| 168 | 168 |
| 169 // Search Engine sync is enabled by default. Register only if explicitly | 169 // Search Engine sync is enabled by default. Register only if explicitly |
| 170 // disabled. | 170 // disabled. |
| 171 if (!command_line_->HasSwitch(switches::kDisableSyncSearchEngines)) { | 171 if (!command_line_->HasSwitch(switches::kDisableSyncSearchEngines)) { |
| 172 pss->RegisterDataTypeController( | 172 pss->RegisterDataTypeController( |
| 173 new SearchEngineDataTypeController(this, profile_, pss)); | 173 new SearchEngineDataTypeController(this, profile_, pss)); |
| 174 } | 174 } |
| 175 | 175 |
| 176 // Session sync is disabled by default. Register only if explicitly | 176 // Session sync is disabled by default. Register only if explicitly |
| 177 // enabled. | 177 // enabled. |
| 178 if (command_line_->HasSwitch(switches::kEnableSyncTabs)) { | 178 if (command_line_->HasSwitch(switches::kEnableSyncTabs)) { |
| 179 pss->RegisterDataTypeController( | 179 pss->RegisterDataTypeController( |
| 180 new SessionDataTypeController(this, profile_, pss)); | 180 new SessionDataTypeController(this, profile_, pss)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 // Extension setting sync is disabled by default. Register only if | 183 // Extension setting sync is disabled by default. Register only if |
| 184 // explicitly enabled. | 184 // explicitly enabled. |
| 185 if (command_line_->HasSwitch(switches::kEnableSyncExtensionSettings)) { | 185 if (command_line_->HasSwitch(switches::kEnableSyncExtensionSettings)) { |
| 186 pss->RegisterDataTypeController( | 186 pss->RegisterDataTypeController( |
| 187 new ExtensionSettingDataTypeController( | 187 new ExtensionSettingDataTypeController( |
| 188 syncable::EXTENSION_SETTINGS, this, profile_, pss)); | 188 syncable::EXTENSION_SETTINGS, this, profile_, pss)); |
| 189 pss->RegisterDataTypeController( | 189 pss->RegisterDataTypeController( |
| 190 new ExtensionSettingDataTypeController( | 190 new ExtensionSettingDataTypeController( |
| 191 syncable::APP_SETTINGS, this, profile_, pss)); | 191 syncable::APP_SETTINGS, this, profile_, pss)); |
| 192 } | 192 } |
| 193 | 193 |
| 194 if (!command_line_->HasSwitch(switches::kDisableSyncAutofillProfile)) { | 194 if (!command_line_->HasSwitch(switches::kDisableSyncAutofillProfile)) { |
| 195 pss->RegisterDataTypeController( | 195 pss->RegisterDataTypeController( |
| 196 new AutofillProfileDataTypeController(this, profile_)); | 196 new AutofillProfileDataTypeController(this, profile_, pss)); |
| 197 } | 197 } |
| 198 | 198 |
| 199 // App notifications sync is enabled by default. Register only if | 199 // App notifications sync is enabled by default. Register only if |
| 200 // explicitly disabled. | 200 // explicitly disabled. |
| 201 if (!command_line_->HasSwitch(switches::kDisableSyncAppNotifications)) { | 201 if (!command_line_->HasSwitch(switches::kDisableSyncAppNotifications)) { |
| 202 pss->RegisterDataTypeController( | 202 pss->RegisterDataTypeController( |
| 203 new AppNotificationDataTypeController(this, profile_, pss)); | 203 new AppNotificationDataTypeController(this, profile_, pss)); |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 | 206 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 GenericChangeProcessor* change_processor = | 411 GenericChangeProcessor* change_processor = |
| 412 new GenericChangeProcessor(error_handler, | 412 new GenericChangeProcessor(error_handler, |
| 413 notif_sync_service, | 413 notif_sync_service, |
| 414 user_share); | 414 user_share); |
| 415 SyncableServiceAdapter* sync_service_adapter = | 415 SyncableServiceAdapter* sync_service_adapter = |
| 416 new SyncableServiceAdapter(syncable::APP_NOTIFICATIONS, | 416 new SyncableServiceAdapter(syncable::APP_NOTIFICATIONS, |
| 417 notif_sync_service, | 417 notif_sync_service, |
| 418 change_processor); | 418 change_processor); |
| 419 return SyncComponents(sync_service_adapter, change_processor); | 419 return SyncComponents(sync_service_adapter, change_processor); |
| 420 } | 420 } |
| OLD | NEW |