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

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

Issue 7819002: Migrate AutofillProfile sync to new API. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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/api/syncable_service.h" 8 #include "chrome/browser/sync/api/syncable_service.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/autofill_profile_change_processor.h"
14 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" 13 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h"
15 #include "chrome/browser/sync/glue/autofill_profile_model_associator.h" 14 #include "chrome/browser/sync/glue/autofill_profile_syncable_service.h"
16 #include "chrome/browser/sync/glue/bookmark_change_processor.h" 15 #include "chrome/browser/sync/glue/bookmark_change_processor.h"
17 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" 16 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h"
18 #include "chrome/browser/sync/glue/bookmark_model_associator.h" 17 #include "chrome/browser/sync/glue/bookmark_model_associator.h"
19 #include "chrome/browser/sync/glue/data_type_manager_impl.h" 18 #include "chrome/browser/sync/glue/data_type_manager_impl.h"
20 #include "chrome/browser/sync/glue/extension_data_type_controller.h" 19 #include "chrome/browser/sync/glue/extension_data_type_controller.h"
21 #include "chrome/browser/sync/glue/generic_change_processor.h" 20 #include "chrome/browser/sync/glue/generic_change_processor.h"
22 #include "chrome/browser/sync/glue/password_change_processor.h" 21 #include "chrome/browser/sync/glue/password_change_processor.h"
23 #include "chrome/browser/sync/glue/password_data_type_controller.h" 22 #include "chrome/browser/sync/glue/password_data_type_controller.h"
24 #include "chrome/browser/sync/glue/password_model_associator.h" 23 #include "chrome/browser/sync/glue/password_model_associator.h"
25 #include "chrome/browser/sync/glue/preference_data_type_controller.h" 24 #include "chrome/browser/sync/glue/preference_data_type_controller.h"
(...skipping 10 matching lines...) Expand all
36 #include "chrome/browser/sync/glue/typed_url_model_associator.h" 35 #include "chrome/browser/sync/glue/typed_url_model_associator.h"
37 #include "chrome/browser/sync/profile_sync_service.h" 36 #include "chrome/browser/sync/profile_sync_service.h"
38 #include "chrome/browser/sync/profile_sync_factory_impl.h" 37 #include "chrome/browser/sync/profile_sync_factory_impl.h"
39 #include "chrome/browser/sync/signin_manager.h" 38 #include "chrome/browser/sync/signin_manager.h"
40 #include "chrome/browser/webdata/web_data_service.h" 39 #include "chrome/browser/webdata/web_data_service.h"
41 #include "chrome/common/chrome_switches.h" 40 #include "chrome/common/chrome_switches.h"
42 #include "chrome/common/pref_names.h" 41 #include "chrome/common/pref_names.h"
43 42
44 using browser_sync::AppDataTypeController; 43 using browser_sync::AppDataTypeController;
45 using browser_sync::AutofillChangeProcessor; 44 using browser_sync::AutofillChangeProcessor;
46 using browser_sync::AutofillProfileChangeProcessor;
47 using browser_sync::AutofillDataTypeController; 45 using browser_sync::AutofillDataTypeController;
48 using browser_sync::AutofillProfileDataTypeController; 46 using browser_sync::AutofillProfileDataTypeController;
49 using browser_sync::AutofillModelAssociator; 47 using browser_sync::AutofillModelAssociator;
50 using browser_sync::AutofillProfileModelAssociator; 48 using browser_sync::AutofillProfileSyncableService;
51 using browser_sync::BookmarkChangeProcessor; 49 using browser_sync::BookmarkChangeProcessor;
52 using browser_sync::BookmarkDataTypeController; 50 using browser_sync::BookmarkDataTypeController;
53 using browser_sync::BookmarkModelAssociator; 51 using browser_sync::BookmarkModelAssociator;
54 using browser_sync::DataTypeController; 52 using browser_sync::DataTypeController;
55 using browser_sync::DataTypeManager; 53 using browser_sync::DataTypeManager;
56 using browser_sync::DataTypeManagerImpl; 54 using browser_sync::DataTypeManagerImpl;
57 using browser_sync::ExtensionDataTypeController; 55 using browser_sync::ExtensionDataTypeController;
58 using browser_sync::GenericChangeProcessor; 56 using browser_sync::GenericChangeProcessor;
59 using browser_sync::PasswordChangeProcessor; 57 using browser_sync::PasswordChangeProcessor;
60 using browser_sync::PasswordDataTypeController; 58 using browser_sync::PasswordDataTypeController;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 error_handler); 194 error_handler);
197 return SyncComponents(model_associator, change_processor); 195 return SyncComponents(model_associator, change_processor);
198 } 196 }
199 197
200 ProfileSyncFactory::SyncComponents 198 ProfileSyncFactory::SyncComponents
201 ProfileSyncFactoryImpl::CreateAutofillProfileSyncComponents( 199 ProfileSyncFactoryImpl::CreateAutofillProfileSyncComponents(
202 ProfileSyncService* profile_sync_service, 200 ProfileSyncService* profile_sync_service,
203 WebDatabase* web_database, 201 WebDatabase* web_database,
204 PersonalDataManager* personal_data, 202 PersonalDataManager* personal_data,
205 browser_sync::UnrecoverableErrorHandler* error_handler) { 203 browser_sync::UnrecoverableErrorHandler* error_handler) {
206 204 AutofillProfileSyncableService* sync_service =
207 AutofillProfileModelAssociator* model_associator = 205 new AutofillProfileSyncableService(web_database, personal_data);
208 new AutofillProfileModelAssociator(profile_sync_service, 206 sync_api::UserShare* user_share = profile_sync_service->GetUserShare();
209 web_database, 207 GenericChangeProcessor* change_processor =
210 personal_data); 208 new GenericChangeProcessor(sync_service, error_handler, user_share);
211 AutofillProfileChangeProcessor* change_processor = 209 browser_sync::SyncableServiceAdapter* sync_service_adapter =
212 new AutofillProfileChangeProcessor(model_associator, 210 new browser_sync::SyncableServiceAdapter(syncable::AUTOFILL_PROFILE,
213 web_database, 211 sync_service,
214 personal_data, 212 change_processor);
215 error_handler); 213 return SyncComponents(sync_service_adapter, change_processor);
216 return SyncComponents(model_associator, change_processor);
217 } 214 }
218 215
219 ProfileSyncFactory::SyncComponents 216 ProfileSyncFactory::SyncComponents
220 ProfileSyncFactoryImpl::CreateBookmarkSyncComponents( 217 ProfileSyncFactoryImpl::CreateBookmarkSyncComponents(
221 ProfileSyncService* profile_sync_service, 218 ProfileSyncService* profile_sync_service,
222 UnrecoverableErrorHandler* error_handler) { 219 UnrecoverableErrorHandler* error_handler) {
223 BookmarkModel* bookmark_model = 220 BookmarkModel* bookmark_model =
224 profile_sync_service->profile()->GetBookmarkModel(); 221 profile_sync_service->profile()->GetBookmarkModel();
225 sync_api::UserShare* user_share = profile_sync_service->GetUserShare(); 222 sync_api::UserShare* user_share = profile_sync_service->GetUserShare();
226 BookmarkModelAssociator* model_associator = 223 BookmarkModelAssociator* model_associator =
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 ProfileSyncFactory::SyncComponents 307 ProfileSyncFactory::SyncComponents
311 ProfileSyncFactoryImpl::CreateSessionSyncComponents( 308 ProfileSyncFactoryImpl::CreateSessionSyncComponents(
312 ProfileSyncService* profile_sync_service, 309 ProfileSyncService* profile_sync_service,
313 UnrecoverableErrorHandler* error_handler) { 310 UnrecoverableErrorHandler* error_handler) {
314 SessionModelAssociator* model_associator = 311 SessionModelAssociator* model_associator =
315 new SessionModelAssociator(profile_sync_service); 312 new SessionModelAssociator(profile_sync_service);
316 SessionChangeProcessor* change_processor = 313 SessionChangeProcessor* change_processor =
317 new SessionChangeProcessor(error_handler, model_associator); 314 new SessionChangeProcessor(error_handler, model_associator);
318 return SyncComponents(model_associator, change_processor); 315 return SyncComponents(model_associator, change_processor);
319 } 316 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698