Index: chrome/browser/sync/profile_sync_factory_impl.cc |
=================================================================== |
--- chrome/browser/sync/profile_sync_factory_impl.cc (revision 97482) |
+++ chrome/browser/sync/profile_sync_factory_impl.cc (working copy) |
@@ -6,7 +6,9 @@ |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/sync/api/syncable_service.h" |
+#include "chrome/browser/sync/glue/app_change_processor.h" |
#include "chrome/browser/sync/glue/app_data_type_controller.h" |
+#include "chrome/browser/sync/glue/app_model_associator.h" |
#include "chrome/browser/sync/glue/autofill_change_processor.h" |
#include "chrome/browser/sync/glue/autofill_data_type_controller.h" |
#include "chrome/browser/sync/glue/autofill_model_associator.h" |
@@ -17,7 +19,10 @@ |
#include "chrome/browser/sync/glue/bookmark_data_type_controller.h" |
#include "chrome/browser/sync/glue/bookmark_model_associator.h" |
#include "chrome/browser/sync/glue/data_type_manager_impl.h" |
+#include "chrome/browser/sync/glue/extension_change_processor.h" |
#include "chrome/browser/sync/glue/extension_data_type_controller.h" |
+#include "chrome/browser/sync/glue/extension_model_associator.h" |
+#include "chrome/browser/sync/glue/extension_sync_traits.h" |
#include "chrome/browser/sync/glue/generic_change_processor.h" |
#include "chrome/browser/sync/glue/password_change_processor.h" |
#include "chrome/browser/sync/glue/password_data_type_controller.h" |
@@ -41,7 +46,9 @@ |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/pref_names.h" |
+using browser_sync::AppChangeProcessor; |
using browser_sync::AppDataTypeController; |
+using browser_sync::AppModelAssociator; |
using browser_sync::AutofillChangeProcessor; |
using browser_sync::AutofillProfileChangeProcessor; |
using browser_sync::AutofillDataTypeController; |
@@ -54,7 +61,9 @@ |
using browser_sync::DataTypeController; |
using browser_sync::DataTypeManager; |
using browser_sync::DataTypeManagerImpl; |
+using browser_sync::ExtensionChangeProcessor; |
using browser_sync::ExtensionDataTypeController; |
+using browser_sync::ExtensionModelAssociator; |
using browser_sync::GenericChangeProcessor; |
using browser_sync::PasswordChangeProcessor; |
using browser_sync::PasswordDataTypeController; |
@@ -166,16 +175,17 @@ |
ProfileSyncFactoryImpl::CreateAppSyncComponents( |
ProfileSyncService* profile_sync_service, |
UnrecoverableErrorHandler* error_handler) { |
- SyncableService* app_sync_service = |
+ // For now we simply use extensions sync objects with the app sync |
+ // traits. If apps become more than simply extensions, we may have |
+ // to write our own apps model associator and/or change processor. |
+ ExtensionServiceInterface* extension_service = |
profile_sync_service->profile()->GetExtensionService(); |
sync_api::UserShare* user_share = profile_sync_service->GetUserShare(); |
- GenericChangeProcessor* change_processor = |
- new GenericChangeProcessor(app_sync_service, error_handler, user_share); |
- browser_sync::SyncableServiceAdapter* sync_service_adapter = |
- new browser_sync::SyncableServiceAdapter(syncable::APPS, |
- app_sync_service, |
- change_processor); |
- return SyncComponents(sync_service_adapter, change_processor); |
+ AppModelAssociator* model_associator = |
+ new AppModelAssociator(extension_service, user_share); |
+ AppChangeProcessor* change_processor = |
+ new AppChangeProcessor(error_handler); |
+ return SyncComponents(model_associator, change_processor); |
} |
ProfileSyncFactory::SyncComponents |
@@ -237,17 +247,14 @@ |
ProfileSyncFactoryImpl::CreateExtensionSyncComponents( |
ProfileSyncService* profile_sync_service, |
UnrecoverableErrorHandler* error_handler) { |
- SyncableService* extension_sync_service = |
+ ExtensionServiceInterface* extension_service = |
profile_sync_service->profile()->GetExtensionService(); |
sync_api::UserShare* user_share = profile_sync_service->GetUserShare(); |
- GenericChangeProcessor* change_processor = |
- new GenericChangeProcessor(extension_sync_service, error_handler, |
- user_share); |
- browser_sync::SyncableServiceAdapter* sync_service_adapter = |
- new browser_sync::SyncableServiceAdapter(syncable::EXTENSIONS, |
- extension_sync_service, |
- change_processor); |
- return SyncComponents(sync_service_adapter, change_processor); |
+ ExtensionModelAssociator* model_associator = |
+ new ExtensionModelAssociator(extension_service, user_share); |
+ ExtensionChangeProcessor* change_processor = |
+ new ExtensionChangeProcessor(error_handler); |
+ return SyncComponents(model_associator, change_processor); |
} |
ProfileSyncFactory::SyncComponents |