| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "chrome/browser/defaults.h" | 7 #include "chrome/browser/defaults.h" |
| 8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
| 9 #include "chrome/browser/sync/glue/autofill_change_processor.h" | 9 #include "chrome/browser/sync/glue/autofill_change_processor.h" |
| 10 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" | 10 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" |
| 11 #include "chrome/browser/sync/glue/autofill_model_associator.h" | 11 #include "chrome/browser/sync/glue/autofill_model_associator.h" |
| 12 #include "chrome/browser/sync/glue/bookmark_change_processor.h" | 12 #include "chrome/browser/sync/glue/bookmark_change_processor.h" |
| 13 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" | 13 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" |
| 14 #include "chrome/browser/sync/glue/bookmark_model_associator.h" | 14 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
| 15 #include "chrome/browser/sync/glue/data_type_manager_impl.h" | 15 #include "chrome/browser/sync/glue/data_type_manager_impl.h" |
| 16 #include "chrome/browser/sync/glue/password_change_processor.h" |
| 17 #include "chrome/browser/sync/glue/password_data_type_controller.h" |
| 18 #include "chrome/browser/sync/glue/password_model_associator.h" |
| 16 #include "chrome/browser/sync/glue/preference_change_processor.h" | 19 #include "chrome/browser/sync/glue/preference_change_processor.h" |
| 17 #include "chrome/browser/sync/glue/preference_data_type_controller.h" | 20 #include "chrome/browser/sync/glue/preference_data_type_controller.h" |
| 18 #include "chrome/browser/sync/glue/preference_model_associator.h" | 21 #include "chrome/browser/sync/glue/preference_model_associator.h" |
| 19 #include "chrome/browser/sync/glue/sync_backend_host.h" | 22 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 20 #include "chrome/browser/sync/glue/theme_change_processor.h" | 23 #include "chrome/browser/sync/glue/theme_change_processor.h" |
| 21 #include "chrome/browser/sync/glue/theme_data_type_controller.h" | 24 #include "chrome/browser/sync/glue/theme_data_type_controller.h" |
| 22 #include "chrome/browser/sync/glue/theme_model_associator.h" | 25 #include "chrome/browser/sync/glue/theme_model_associator.h" |
| 23 #include "chrome/browser/sync/glue/typed_url_change_processor.h" | 26 #include "chrome/browser/sync/glue/typed_url_change_processor.h" |
| 24 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 27 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
| 25 #include "chrome/browser/sync/glue/typed_url_model_associator.h" | 28 #include "chrome/browser/sync/glue/typed_url_model_associator.h" |
| 26 #include "chrome/browser/sync/profile_sync_service.h" | 29 #include "chrome/browser/sync/profile_sync_service.h" |
| 27 #include "chrome/browser/sync/profile_sync_factory_impl.h" | 30 #include "chrome/browser/sync/profile_sync_factory_impl.h" |
| 28 #include "chrome/browser/webdata/web_data_service.h" | 31 #include "chrome/browser/webdata/web_data_service.h" |
| 29 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 30 | 33 |
| 31 using browser_sync::AutofillChangeProcessor; | 34 using browser_sync::AutofillChangeProcessor; |
| 32 using browser_sync::AutofillDataTypeController; | 35 using browser_sync::AutofillDataTypeController; |
| 33 using browser_sync::AutofillModelAssociator; | 36 using browser_sync::AutofillModelAssociator; |
| 34 using browser_sync::BookmarkChangeProcessor; | 37 using browser_sync::BookmarkChangeProcessor; |
| 35 using browser_sync::BookmarkDataTypeController; | 38 using browser_sync::BookmarkDataTypeController; |
| 36 using browser_sync::BookmarkModelAssociator; | 39 using browser_sync::BookmarkModelAssociator; |
| 37 using browser_sync::DataTypeController; | 40 using browser_sync::DataTypeController; |
| 38 using browser_sync::DataTypeManager; | 41 using browser_sync::DataTypeManager; |
| 39 using browser_sync::DataTypeManagerImpl; | 42 using browser_sync::DataTypeManagerImpl; |
| 43 using browser_sync::PasswordChangeProcessor; |
| 44 using browser_sync::PasswordDataTypeController; |
| 45 using browser_sync::PasswordModelAssociator; |
| 40 using browser_sync::PreferenceChangeProcessor; | 46 using browser_sync::PreferenceChangeProcessor; |
| 41 using browser_sync::PreferenceDataTypeController; | 47 using browser_sync::PreferenceDataTypeController; |
| 42 using browser_sync::PreferenceModelAssociator; | 48 using browser_sync::PreferenceModelAssociator; |
| 43 using browser_sync::SyncBackendHost; | 49 using browser_sync::SyncBackendHost; |
| 44 using browser_sync::ThemeChangeProcessor; | 50 using browser_sync::ThemeChangeProcessor; |
| 45 using browser_sync::ThemeDataTypeController; | 51 using browser_sync::ThemeDataTypeController; |
| 46 using browser_sync::ThemeModelAssociator; | 52 using browser_sync::ThemeModelAssociator; |
| 47 using browser_sync::TypedUrlChangeProcessor; | 53 using browser_sync::TypedUrlChangeProcessor; |
| 48 using browser_sync::TypedUrlDataTypeController; | 54 using browser_sync::TypedUrlDataTypeController; |
| 49 using browser_sync::TypedUrlModelAssociator; | 55 using browser_sync::TypedUrlModelAssociator; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 75 new AutofillDataTypeController(this, profile_, pss)); | 81 new AutofillDataTypeController(this, profile_, pss)); |
| 76 } | 82 } |
| 77 | 83 |
| 78 // Bookmark sync is enabled by default. Register unless explicitly | 84 // Bookmark sync is enabled by default. Register unless explicitly |
| 79 // disabled. | 85 // disabled. |
| 80 if (!command_line_->HasSwitch(switches::kDisableSyncBookmarks)) { | 86 if (!command_line_->HasSwitch(switches::kDisableSyncBookmarks)) { |
| 81 pss->RegisterDataTypeController( | 87 pss->RegisterDataTypeController( |
| 82 new BookmarkDataTypeController(this, profile_, pss)); | 88 new BookmarkDataTypeController(this, profile_, pss)); |
| 83 } | 89 } |
| 84 | 90 |
| 91 // Password sync is disabled by default. Register only if |
| 92 // explicitly enabled. |
| 93 if (command_line_->HasSwitch(switches::kEnableSyncPasswords)) { |
| 94 pss->RegisterDataTypeController( |
| 95 new PasswordDataTypeController(this, profile_, pss)); |
| 96 } |
| 97 |
| 85 // Preference sync is enabled by default. Register unless explicitly | 98 // Preference sync is enabled by default. Register unless explicitly |
| 86 // disabled. | 99 // disabled. |
| 87 if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { | 100 if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { |
| 88 pss->RegisterDataTypeController( | 101 pss->RegisterDataTypeController( |
| 89 new PreferenceDataTypeController(this, pss)); | 102 new PreferenceDataTypeController(this, pss)); |
| 90 } | 103 } |
| 91 | 104 |
| 92 // Theme sync is enabled by default. Register unless explicitly disabled. | 105 // Theme sync is enabled by default. Register unless explicitly disabled. |
| 93 if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { | 106 if (!command_line_->HasSwitch(switches::kDisableSyncThemes)) { |
| 94 pss->RegisterDataTypeController( | 107 pss->RegisterDataTypeController( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 BookmarkModelAssociator* model_associator = | 150 BookmarkModelAssociator* model_associator = |
| 138 new BookmarkModelAssociator(profile_sync_service, | 151 new BookmarkModelAssociator(profile_sync_service, |
| 139 error_handler); | 152 error_handler); |
| 140 BookmarkChangeProcessor* change_processor = | 153 BookmarkChangeProcessor* change_processor = |
| 141 new BookmarkChangeProcessor(model_associator, | 154 new BookmarkChangeProcessor(model_associator, |
| 142 error_handler); | 155 error_handler); |
| 143 return SyncComponents(model_associator, change_processor); | 156 return SyncComponents(model_associator, change_processor); |
| 144 } | 157 } |
| 145 | 158 |
| 146 ProfileSyncFactory::SyncComponents | 159 ProfileSyncFactory::SyncComponents |
| 160 ProfileSyncFactoryImpl::CreatePasswordSyncComponents( |
| 161 ProfileSyncService* profile_sync_service, |
| 162 PasswordStore* password_store, |
| 163 UnrecoverableErrorHandler* error_handler) { |
| 164 PasswordModelAssociator* model_associator = |
| 165 new PasswordModelAssociator(profile_sync_service, |
| 166 password_store, |
| 167 error_handler); |
| 168 PasswordChangeProcessor* change_processor = |
| 169 new PasswordChangeProcessor(model_associator, |
| 170 password_store, |
| 171 error_handler); |
| 172 return SyncComponents(model_associator, change_processor); |
| 173 } |
| 174 |
| 175 ProfileSyncFactory::SyncComponents |
| 147 ProfileSyncFactoryImpl::CreatePreferenceSyncComponents( | 176 ProfileSyncFactoryImpl::CreatePreferenceSyncComponents( |
| 148 ProfileSyncService* profile_sync_service, | 177 ProfileSyncService* profile_sync_service, |
| 149 UnrecoverableErrorHandler* error_handler) { | 178 UnrecoverableErrorHandler* error_handler) { |
| 150 PreferenceModelAssociator* model_associator = | 179 PreferenceModelAssociator* model_associator = |
| 151 new PreferenceModelAssociator(profile_sync_service, | 180 new PreferenceModelAssociator(profile_sync_service, |
| 152 error_handler); | 181 error_handler); |
| 153 PreferenceChangeProcessor* change_processor = | 182 PreferenceChangeProcessor* change_processor = |
| 154 new PreferenceChangeProcessor(model_associator, | 183 new PreferenceChangeProcessor(model_associator, |
| 155 error_handler); | 184 error_handler); |
| 156 return SyncComponents(model_associator, change_processor); | 185 return SyncComponents(model_associator, change_processor); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 176 TypedUrlModelAssociator* model_associator = | 205 TypedUrlModelAssociator* model_associator = |
| 177 new TypedUrlModelAssociator(profile_sync_service, | 206 new TypedUrlModelAssociator(profile_sync_service, |
| 178 history_backend, | 207 history_backend, |
| 179 error_handler); | 208 error_handler); |
| 180 TypedUrlChangeProcessor* change_processor = | 209 TypedUrlChangeProcessor* change_processor = |
| 181 new TypedUrlChangeProcessor(model_associator, | 210 new TypedUrlChangeProcessor(model_associator, |
| 182 history_backend, | 211 history_backend, |
| 183 error_handler); | 212 error_handler); |
| 184 return SyncComponents(model_associator, change_processor); | 213 return SyncComponents(model_associator, change_processor); |
| 185 } | 214 } |
| OLD | NEW |