Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Side by Side Diff: chrome/browser/sync/profile_sync_factory_impl.cc

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really fix. And rebase Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/extension_service.h" 6 #include "chrome/browser/extensions/extension_service.h"
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/sync/glue/app_change_processor.h" 8 #include "chrome/browser/sync/glue/app_change_processor.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/app_model_associator.h" 10 #include "chrome/browser/sync/glue/app_model_associator.h"
11 #include "chrome/browser/sync/glue/autofill_change_processor.h" 11 #include "chrome/browser/sync/glue/autofill_change_processor.h"
12 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" 12 #include "chrome/browser/sync/glue/autofill_data_type_controller.h"
13 #include "chrome/browser/sync/glue/autofill_model_associator.h" 13 #include "chrome/browser/sync/glue/autofill_model_associator.h"
14 #include "chrome/browser/sync/glue/autofill_profile_change_processor.h" 14 #include "chrome/browser/sync/glue/autofill_profile_change_processor.h"
15 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" 15 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h"
16 #include "chrome/browser/sync/glue/autofill_profile_model_associator.h" 16 #include "chrome/browser/sync/glue/autofill_profile_model_associator.h"
17 #include "chrome/browser/sync/glue/bookmark_change_processor.h" 17 #include "chrome/browser/sync/glue/bookmark_change_processor.h"
18 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" 18 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h"
19 #include "chrome/browser/sync/glue/bookmark_model_associator.h" 19 #include "chrome/browser/sync/glue/bookmark_model_associator.h"
20 #include "chrome/browser/sync/glue/data_type_manager_impl.h" 20 #include "chrome/browser/sync/glue/data_type_manager_impl.h"
21 #include "chrome/browser/sync/glue/extension_change_processor.h" 21 #include "chrome/browser/sync/glue/extension_change_processor.h"
22 #include "chrome/browser/sync/glue/extension_data_type_controller.h" 22 #include "chrome/browser/sync/glue/extension_data_type_controller.h"
23 #include "chrome/browser/sync/glue/extension_model_associator.h" 23 #include "chrome/browser/sync/glue/extension_model_associator.h"
24 #include "chrome/browser/sync/glue/extension_sync_traits.h" 24 #include "chrome/browser/sync/glue/extension_sync_traits.h"
25 #include "chrome/browser/sync/glue/generic_change_processor.h"
25 #include "chrome/browser/sync/glue/password_change_processor.h" 26 #include "chrome/browser/sync/glue/password_change_processor.h"
26 #include "chrome/browser/sync/glue/password_data_type_controller.h" 27 #include "chrome/browser/sync/glue/password_data_type_controller.h"
27 #include "chrome/browser/sync/glue/password_model_associator.h" 28 #include "chrome/browser/sync/glue/password_model_associator.h"
28 #include "chrome/browser/sync/glue/preference_change_processor.h"
29 #include "chrome/browser/sync/glue/preference_data_type_controller.h" 29 #include "chrome/browser/sync/glue/preference_data_type_controller.h"
30 #include "chrome/browser/sync/glue/preference_model_associator.h"
31 #include "chrome/browser/sync/glue/session_change_processor.h" 30 #include "chrome/browser/sync/glue/session_change_processor.h"
32 #include "chrome/browser/sync/glue/session_data_type_controller.h" 31 #include "chrome/browser/sync/glue/session_data_type_controller.h"
33 #include "chrome/browser/sync/glue/session_model_associator.h" 32 #include "chrome/browser/sync/glue/session_model_associator.h"
34 #include "chrome/browser/sync/glue/sync_backend_host.h" 33 #include "chrome/browser/sync/glue/sync_backend_host.h"
35 #include "chrome/browser/sync/glue/theme_change_processor.h" 34 #include "chrome/browser/sync/glue/theme_change_processor.h"
36 #include "chrome/browser/sync/glue/theme_data_type_controller.h" 35 #include "chrome/browser/sync/glue/theme_data_type_controller.h"
37 #include "chrome/browser/sync/glue/theme_model_associator.h" 36 #include "chrome/browser/sync/glue/theme_model_associator.h"
38 #include "chrome/browser/sync/glue/typed_url_change_processor.h" 37 #include "chrome/browser/sync/glue/typed_url_change_processor.h"
39 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" 38 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h"
40 #include "chrome/browser/sync/glue/typed_url_model_associator.h" 39 #include "chrome/browser/sync/glue/typed_url_model_associator.h"
41 #include "chrome/browser/sync/profile_sync_service.h" 40 #include "chrome/browser/sync/profile_sync_service.h"
42 #include "chrome/browser/sync/profile_sync_factory_impl.h" 41 #include "chrome/browser/sync/profile_sync_factory_impl.h"
42 #include "chrome/browser/sync/syncable_service.h"
43 #include "chrome/browser/webdata/web_data_service.h" 43 #include "chrome/browser/webdata/web_data_service.h"
44 #include "chrome/common/chrome_switches.h" 44 #include "chrome/common/chrome_switches.h"
45 45
46 using browser_sync::AppChangeProcessor; 46 using browser_sync::AppChangeProcessor;
47 using browser_sync::AppDataTypeController; 47 using browser_sync::AppDataTypeController;
48 using browser_sync::AppModelAssociator; 48 using browser_sync::AppModelAssociator;
49 using browser_sync::AutofillChangeProcessor; 49 using browser_sync::AutofillChangeProcessor;
50 using browser_sync::AutofillProfileChangeProcessor; 50 using browser_sync::AutofillProfileChangeProcessor;
51 using browser_sync::AutofillDataTypeController; 51 using browser_sync::AutofillDataTypeController;
52 using browser_sync::AutofillProfileDataTypeController; 52 using browser_sync::AutofillProfileDataTypeController;
53 using browser_sync::AutofillModelAssociator; 53 using browser_sync::AutofillModelAssociator;
54 using browser_sync::AutofillProfileModelAssociator; 54 using browser_sync::AutofillProfileModelAssociator;
55 using browser_sync::BookmarkChangeProcessor; 55 using browser_sync::BookmarkChangeProcessor;
56 using browser_sync::BookmarkDataTypeController; 56 using browser_sync::BookmarkDataTypeController;
57 using browser_sync::BookmarkModelAssociator; 57 using browser_sync::BookmarkModelAssociator;
58 using browser_sync::DataTypeController; 58 using browser_sync::DataTypeController;
59 using browser_sync::DataTypeManager; 59 using browser_sync::DataTypeManager;
60 using browser_sync::DataTypeManagerImpl; 60 using browser_sync::DataTypeManagerImpl;
61 using browser_sync::ExtensionChangeProcessor; 61 using browser_sync::ExtensionChangeProcessor;
62 using browser_sync::ExtensionDataTypeController; 62 using browser_sync::ExtensionDataTypeController;
63 using browser_sync::ExtensionModelAssociator; 63 using browser_sync::ExtensionModelAssociator;
64 using browser_sync::GenericChangeProcessor;
64 using browser_sync::PasswordChangeProcessor; 65 using browser_sync::PasswordChangeProcessor;
65 using browser_sync::PasswordDataTypeController; 66 using browser_sync::PasswordDataTypeController;
66 using browser_sync::PasswordModelAssociator; 67 using browser_sync::PasswordModelAssociator;
67 using browser_sync::PreferenceChangeProcessor;
68 using browser_sync::PreferenceDataTypeController; 68 using browser_sync::PreferenceDataTypeController;
69 using browser_sync::PreferenceModelAssociator;
70 using browser_sync::SessionChangeProcessor; 69 using browser_sync::SessionChangeProcessor;
71 using browser_sync::SessionDataTypeController; 70 using browser_sync::SessionDataTypeController;
72 using browser_sync::SessionModelAssociator; 71 using browser_sync::SessionModelAssociator;
73 using browser_sync::SyncBackendHost; 72 using browser_sync::SyncBackendHost;
74 using browser_sync::ThemeChangeProcessor; 73 using browser_sync::ThemeChangeProcessor;
75 using browser_sync::ThemeDataTypeController; 74 using browser_sync::ThemeDataTypeController;
76 using browser_sync::ThemeModelAssociator; 75 using browser_sync::ThemeModelAssociator;
77 using browser_sync::TypedUrlChangeProcessor; 76 using browser_sync::TypedUrlChangeProcessor;
78 using browser_sync::TypedUrlDataTypeController; 77 using browser_sync::TypedUrlDataTypeController;
79 using browser_sync::TypedUrlModelAssociator; 78 using browser_sync::TypedUrlModelAssociator;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 new PasswordChangeProcessor(model_associator, 265 new PasswordChangeProcessor(model_associator,
267 password_store, 266 password_store,
268 error_handler); 267 error_handler);
269 return SyncComponents(model_associator, change_processor); 268 return SyncComponents(model_associator, change_processor);
270 } 269 }
271 270
272 ProfileSyncFactory::SyncComponents 271 ProfileSyncFactory::SyncComponents
273 ProfileSyncFactoryImpl::CreatePreferenceSyncComponents( 272 ProfileSyncFactoryImpl::CreatePreferenceSyncComponents(
274 ProfileSyncService* profile_sync_service, 273 ProfileSyncService* profile_sync_service,
275 UnrecoverableErrorHandler* error_handler) { 274 UnrecoverableErrorHandler* error_handler) {
276 PreferenceModelAssociator* model_associator = 275 SyncableService* pref_sync_service =
277 new PreferenceModelAssociator(profile_sync_service); 276 profile_->GetPrefs()->GetSyncableService();
278 PreferenceChangeProcessor* change_processor = 277 GenericChangeProcessor* change_processor =
279 new PreferenceChangeProcessor(model_associator, 278 new GenericChangeProcessor(pref_sync_service, error_handler);
280 error_handler); 279 return SyncComponents(pref_sync_service, change_processor);
281 return SyncComponents(model_associator, change_processor);
282 } 280 }
283 281
284 ProfileSyncFactory::SyncComponents 282 ProfileSyncFactory::SyncComponents
285 ProfileSyncFactoryImpl::CreateThemeSyncComponents( 283 ProfileSyncFactoryImpl::CreateThemeSyncComponents(
286 ProfileSyncService* profile_sync_service, 284 ProfileSyncService* profile_sync_service,
287 UnrecoverableErrorHandler* error_handler) { 285 UnrecoverableErrorHandler* error_handler) {
288 ThemeModelAssociator* model_associator = 286 ThemeModelAssociator* model_associator =
289 new ThemeModelAssociator(profile_sync_service); 287 new ThemeModelAssociator(profile_sync_service);
290 ThemeChangeProcessor* change_processor = 288 ThemeChangeProcessor* change_processor =
291 new ThemeChangeProcessor(error_handler); 289 new ThemeChangeProcessor(error_handler);
(...skipping 18 matching lines...) Expand all
310 ProfileSyncFactory::SyncComponents 308 ProfileSyncFactory::SyncComponents
311 ProfileSyncFactoryImpl::CreateSessionSyncComponents( 309 ProfileSyncFactoryImpl::CreateSessionSyncComponents(
312 ProfileSyncService* profile_sync_service, 310 ProfileSyncService* profile_sync_service,
313 UnrecoverableErrorHandler* error_handler) { 311 UnrecoverableErrorHandler* error_handler) {
314 SessionModelAssociator* model_associator = 312 SessionModelAssociator* model_associator =
315 new SessionModelAssociator(profile_sync_service); 313 new SessionModelAssociator(profile_sync_service);
316 SessionChangeProcessor* change_processor = 314 SessionChangeProcessor* change_processor =
317 new SessionChangeProcessor(error_handler, model_associator); 315 new SessionChangeProcessor(error_handler, model_associator);
318 return SyncComponents(model_associator, change_processor); 316 return SyncComponents(model_associator, change_processor);
319 } 317 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/theme_data_type_controller.cc ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698