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/app_data_type_controller.h" | 9 #include "chrome/browser/sync/glue/app_data_type_controller.h" |
10 #include "chrome/browser/sync/glue/autofill_change_processor.h" | 10 #include "chrome/browser/sync/glue/autofill_change_processor.h" |
11 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" | 11 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" |
12 #include "chrome/browser/sync/glue/autofill_model_associator.h" | 12 #include "chrome/browser/sync/glue/autofill_model_associator.h" |
13 #include "chrome/browser/sync/glue/bookmark_change_processor.h" | 13 #include "chrome/browser/sync/glue/bookmark_change_processor.h" |
14 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" | 14 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" |
15 #include "chrome/browser/sync/glue/bookmark_model_associator.h" | 15 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
16 #include "chrome/browser/sync/glue/data_type_manager_impl.h" | 16 #include "chrome/browser/sync/glue/data_type_manager_impl.h" |
17 #include "chrome/browser/sync/glue/extension_change_processor.h" | 17 #include "chrome/browser/sync/glue/extension_change_processor.h" |
18 #include "chrome/browser/sync/glue/extension_data_type_controller.h" | 18 #include "chrome/browser/sync/glue/extension_data_type_controller.h" |
19 #include "chrome/browser/sync/glue/extension_model_associator.h" | 19 #include "chrome/browser/sync/glue/extension_model_associator.h" |
20 #include "chrome/browser/sync/glue/extension_sync_traits.h" | 20 #include "chrome/browser/sync/glue/extension_sync_traits.h" |
21 #include "chrome/browser/sync/glue/password_change_processor.h" | 21 #include "chrome/browser/sync/glue/password_change_processor.h" |
22 #include "chrome/browser/sync/glue/password_data_type_controller.h" | 22 #include "chrome/browser/sync/glue/password_data_type_controller.h" |
23 #include "chrome/browser/sync/glue/password_model_associator.h" | 23 #include "chrome/browser/sync/glue/password_model_associator.h" |
24 #include "chrome/browser/sync/glue/preference_change_processor.h" | 24 #include "chrome/browser/sync/glue/preference_change_processor.h" |
25 #include "chrome/browser/sync/glue/preference_data_type_controller.h" | 25 #include "chrome/browser/sync/glue/preference_data_type_controller.h" |
26 #include "chrome/browser/sync/glue/preference_model_associator.h" | 26 #include "chrome/browser/sync/glue/preference_model_associator.h" |
27 #include "chrome/browser/sync/glue/session_change_processor.h" | |
28 #include "chrome/browser/sync/glue/session_data_type_controller.h" | |
29 #include "chrome/browser/sync/glue/session_model_associator.h" | |
30 #include "chrome/browser/sync/glue/sync_backend_host.h" | 27 #include "chrome/browser/sync/glue/sync_backend_host.h" |
31 #include "chrome/browser/sync/glue/theme_change_processor.h" | 28 #include "chrome/browser/sync/glue/theme_change_processor.h" |
32 #include "chrome/browser/sync/glue/theme_data_type_controller.h" | 29 #include "chrome/browser/sync/glue/theme_data_type_controller.h" |
33 #include "chrome/browser/sync/glue/theme_model_associator.h" | 30 #include "chrome/browser/sync/glue/theme_model_associator.h" |
34 #include "chrome/browser/sync/glue/typed_url_change_processor.h" | 31 #include "chrome/browser/sync/glue/typed_url_change_processor.h" |
35 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 32 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
36 #include "chrome/browser/sync/glue/typed_url_model_associator.h" | 33 #include "chrome/browser/sync/glue/typed_url_model_associator.h" |
37 #include "chrome/browser/sync/profile_sync_service.h" | 34 #include "chrome/browser/sync/profile_sync_service.h" |
38 #include "chrome/browser/sync/profile_sync_factory_impl.h" | 35 #include "chrome/browser/sync/profile_sync_factory_impl.h" |
39 #include "chrome/browser/webdata/web_data_service.h" | 36 #include "chrome/browser/webdata/web_data_service.h" |
(...skipping 11 matching lines...) Expand all Loading... |
51 using browser_sync::DataTypeManagerImpl; | 48 using browser_sync::DataTypeManagerImpl; |
52 using browser_sync::ExtensionChangeProcessor; | 49 using browser_sync::ExtensionChangeProcessor; |
53 using browser_sync::ExtensionDataTypeController; | 50 using browser_sync::ExtensionDataTypeController; |
54 using browser_sync::ExtensionModelAssociator; | 51 using browser_sync::ExtensionModelAssociator; |
55 using browser_sync::PasswordChangeProcessor; | 52 using browser_sync::PasswordChangeProcessor; |
56 using browser_sync::PasswordDataTypeController; | 53 using browser_sync::PasswordDataTypeController; |
57 using browser_sync::PasswordModelAssociator; | 54 using browser_sync::PasswordModelAssociator; |
58 using browser_sync::PreferenceChangeProcessor; | 55 using browser_sync::PreferenceChangeProcessor; |
59 using browser_sync::PreferenceDataTypeController; | 56 using browser_sync::PreferenceDataTypeController; |
60 using browser_sync::PreferenceModelAssociator; | 57 using browser_sync::PreferenceModelAssociator; |
61 using browser_sync::SessionChangeProcessor; | |
62 using browser_sync::SessionDataTypeController; | |
63 using browser_sync::SessionModelAssociator; | |
64 using browser_sync::SyncBackendHost; | 58 using browser_sync::SyncBackendHost; |
65 using browser_sync::ThemeChangeProcessor; | 59 using browser_sync::ThemeChangeProcessor; |
66 using browser_sync::ThemeDataTypeController; | 60 using browser_sync::ThemeDataTypeController; |
67 using browser_sync::ThemeModelAssociator; | 61 using browser_sync::ThemeModelAssociator; |
68 using browser_sync::TypedUrlChangeProcessor; | 62 using browser_sync::TypedUrlChangeProcessor; |
69 using browser_sync::TypedUrlDataTypeController; | 63 using browser_sync::TypedUrlDataTypeController; |
70 using browser_sync::TypedUrlModelAssociator; | 64 using browser_sync::TypedUrlModelAssociator; |
71 using browser_sync::UnrecoverableErrorHandler; | 65 using browser_sync::UnrecoverableErrorHandler; |
72 | 66 |
73 ProfileSyncFactoryImpl::ProfileSyncFactoryImpl(Profile* profile, | 67 ProfileSyncFactoryImpl::ProfileSyncFactoryImpl(Profile* profile, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 new ThemeDataTypeController(this, profile_, pss)); | 122 new ThemeDataTypeController(this, profile_, pss)); |
129 } | 123 } |
130 | 124 |
131 // TypedUrl sync is disabled by default. Register only if | 125 // TypedUrl sync is disabled by default. Register only if |
132 // explicitly enabled. | 126 // explicitly enabled. |
133 if (command_line_->HasSwitch(switches::kEnableSyncTypedUrls)) { | 127 if (command_line_->HasSwitch(switches::kEnableSyncTypedUrls)) { |
134 pss->RegisterDataTypeController( | 128 pss->RegisterDataTypeController( |
135 new TypedUrlDataTypeController(this, profile_, pss)); | 129 new TypedUrlDataTypeController(this, profile_, pss)); |
136 } | 130 } |
137 | 131 |
138 // Session sync is enabled by default. Register unless explicitly | |
139 // disabled. | |
140 if (!command_line_->HasSwitch(switches::kDisableSyncSessions)) { | |
141 pss->RegisterDataTypeController( | |
142 new SessionDataTypeController(this, pss)); | |
143 } | |
144 return pss; | 132 return pss; |
145 } | 133 } |
146 | 134 |
147 DataTypeManager* ProfileSyncFactoryImpl::CreateDataTypeManager( | 135 DataTypeManager* ProfileSyncFactoryImpl::CreateDataTypeManager( |
148 SyncBackendHost* backend, | 136 SyncBackendHost* backend, |
149 const DataTypeController::TypeMap& controllers) { | 137 const DataTypeController::TypeMap& controllers) { |
150 return new DataTypeManagerImpl(backend, controllers); | 138 return new DataTypeManagerImpl(backend, controllers); |
151 } | 139 } |
152 | 140 |
153 ProfileSyncFactory::SyncComponents | 141 ProfileSyncFactory::SyncComponents |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 browser_sync::UnrecoverableErrorHandler* error_handler) { | 242 browser_sync::UnrecoverableErrorHandler* error_handler) { |
255 TypedUrlModelAssociator* model_associator = | 243 TypedUrlModelAssociator* model_associator = |
256 new TypedUrlModelAssociator(profile_sync_service, | 244 new TypedUrlModelAssociator(profile_sync_service, |
257 history_backend); | 245 history_backend); |
258 TypedUrlChangeProcessor* change_processor = | 246 TypedUrlChangeProcessor* change_processor = |
259 new TypedUrlChangeProcessor(model_associator, | 247 new TypedUrlChangeProcessor(model_associator, |
260 history_backend, | 248 history_backend, |
261 error_handler); | 249 error_handler); |
262 return SyncComponents(model_associator, change_processor); | 250 return SyncComponents(model_associator, change_processor); |
263 } | 251 } |
264 | |
265 ProfileSyncFactory::SyncComponents | |
266 ProfileSyncFactoryImpl::CreateSessionSyncComponents( | |
267 ProfileSyncService* profile_sync_service, | |
268 UnrecoverableErrorHandler* error_handler) { | |
269 SessionModelAssociator* model_associator = | |
270 new SessionModelAssociator(profile_sync_service); | |
271 SessionChangeProcessor* change_processor = | |
272 new SessionChangeProcessor(error_handler, model_associator); | |
273 return SyncComponents(model_associator, change_processor); | |
274 } | |
275 | |
OLD | NEW |