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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 !command_line_->HasSwitch(switches::kDisableSyncTypedUrls)) { | 124 !command_line_->HasSwitch(switches::kDisableSyncTypedUrls)) { |
125 pss->RegisterDataTypeController( | 125 pss->RegisterDataTypeController( |
126 new TypedUrlDataTypeController(this, profile_, pss)); | 126 new TypedUrlDataTypeController(this, profile_, pss)); |
127 } | 127 } |
128 | 128 |
129 // Session sync is enabled by default. Register unless explicitly disabled. | 129 // Session sync is enabled by default. Register unless explicitly disabled. |
130 if (!command_line_->HasSwitch(switches::kDisableSyncTabs)) { | 130 if (!command_line_->HasSwitch(switches::kDisableSyncTabs)) { |
131 pss->RegisterDataTypeController( | 131 pss->RegisterDataTypeController( |
132 new SessionDataTypeController(this, profile_, pss)); | 132 new SessionDataTypeController(this, profile_, pss)); |
133 } | 133 } |
| 134 |
| 135 // Password sync is enabled by default. Register unless explicitly |
| 136 // disabled. |
| 137 if (!command_line_->HasSwitch(switches::kDisableSyncPasswords)) { |
| 138 #if !defined(OS_ANDROID) |
| 139 pss->RegisterDataTypeController( |
| 140 new PasswordDataTypeController(this, profile_, pss)); |
| 141 #else |
| 142 // On Android, enable password sync only when Keystore encryption |
| 143 // is enabled. |
| 144 if (command_line_->HasSwitch(switches::kSyncKeystoreEncryption)) { |
| 145 pss->RegisterDataTypeController( |
| 146 new PasswordDataTypeController(this, profile_, pss)); |
| 147 } |
| 148 #endif |
| 149 } |
134 } | 150 } |
135 | 151 |
136 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( | 152 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( |
137 ProfileSyncService* pss) { | 153 ProfileSyncService* pss) { |
138 // App sync is enabled by default. Register unless explicitly | 154 // App sync is enabled by default. Register unless explicitly |
139 // disabled. | 155 // disabled. |
140 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { | 156 if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { |
141 pss->RegisterDataTypeController( | 157 pss->RegisterDataTypeController( |
142 new ExtensionDataTypeController(syncer::APPS, this, profile_, pss)); | 158 new ExtensionDataTypeController(syncer::APPS, this, profile_, pss)); |
143 } | 159 } |
144 | 160 |
145 // Autofill sync is enabled by default. Register unless explicitly | 161 // Autofill sync is enabled by default. Register unless explicitly |
146 // disabled. | 162 // disabled. |
147 if (!command_line_->HasSwitch(switches::kDisableSyncAutofill)) { | 163 if (!command_line_->HasSwitch(switches::kDisableSyncAutofill)) { |
148 pss->RegisterDataTypeController( | 164 pss->RegisterDataTypeController( |
149 new AutofillDataTypeController(this, profile_, pss)); | 165 new AutofillDataTypeController(this, profile_, pss)); |
150 } | 166 } |
151 | 167 |
152 // Extension sync is enabled by default. Register unless explicitly | 168 // Extension sync is enabled by default. Register unless explicitly |
153 // disabled. | 169 // disabled. |
154 if (!command_line_->HasSwitch(switches::kDisableSyncExtensions)) { | 170 if (!command_line_->HasSwitch(switches::kDisableSyncExtensions)) { |
155 pss->RegisterDataTypeController( | 171 pss->RegisterDataTypeController( |
156 new ExtensionDataTypeController(syncer::EXTENSIONS, | 172 new ExtensionDataTypeController(syncer::EXTENSIONS, |
157 this, profile_, pss)); | 173 this, profile_, pss)); |
158 } | 174 } |
159 | 175 |
160 // Password sync is enabled by default. Register unless explicitly | |
161 // disabled. | |
162 if (!command_line_->HasSwitch(switches::kDisableSyncPasswords)) { | |
163 pss->RegisterDataTypeController( | |
164 new PasswordDataTypeController(this, profile_, pss)); | |
165 } | |
166 | |
167 // Preference sync is enabled by default. Register unless explicitly | 176 // Preference sync is enabled by default. Register unless explicitly |
168 // disabled. | 177 // disabled. |
169 if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { | 178 if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { |
170 pss->RegisterDataTypeController( | 179 pss->RegisterDataTypeController( |
171 new UIDataTypeController(syncer::PREFERENCES, this, profile_, pss)); | 180 new UIDataTypeController(syncer::PREFERENCES, this, profile_, pss)); |
172 } | 181 } |
173 | 182 |
174 #if defined(ENABLE_THEMES) | 183 #if defined(ENABLE_THEMES) |
175 // Theme sync is enabled by default. Register unless explicitly disabled. | 184 // Theme sync is enabled by default. Register unless explicitly disabled. |
176 if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { | 185 if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 ProfileSyncComponentsFactory::SyncComponents | 378 ProfileSyncComponentsFactory::SyncComponents |
370 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 379 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
371 ProfileSyncService* profile_sync_service, | 380 ProfileSyncService* profile_sync_service, |
372 DataTypeErrorHandler* error_handler) { | 381 DataTypeErrorHandler* error_handler) { |
373 SessionModelAssociator* model_associator = | 382 SessionModelAssociator* model_associator = |
374 new SessionModelAssociator(profile_sync_service, error_handler); | 383 new SessionModelAssociator(profile_sync_service, error_handler); |
375 SessionChangeProcessor* change_processor = | 384 SessionChangeProcessor* change_processor = |
376 new SessionChangeProcessor(error_handler, model_associator); | 385 new SessionChangeProcessor(error_handler, model_associator); |
377 return SyncComponents(model_associator, change_processor); | 386 return SyncComponents(model_associator, change_processor); |
378 } | 387 } |
OLD | NEW |