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

Unified Diff: chrome/browser/sync/profile_sync_factory_impl.cc

Issue 7564037: Apps/Extensions Sync refactoring -- delete most of the old glue, implement new sync API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Release build warning :-/ Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/glue/extension_util_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_factory_impl.cc
diff --git a/chrome/browser/sync/profile_sync_factory_impl.cc b/chrome/browser/sync/profile_sync_factory_impl.cc
index 9188f7ff8c3c0318d04860b1cc2cdac174c1120f..6a05f32485b4ddfbd258418d7cb9c497cdf2ec43 100644
--- a/chrome/browser/sync/profile_sync_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_factory_impl.cc
@@ -6,9 +6,7 @@
#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"
@@ -19,10 +17,7 @@
#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"
@@ -46,9 +41,7 @@
#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;
@@ -61,9 +54,7 @@ using browser_sync::BookmarkModelAssociator;
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;
@@ -175,17 +166,16 @@ ProfileSyncFactory::SyncComponents
ProfileSyncFactoryImpl::CreateAppSyncComponents(
ProfileSyncService* profile_sync_service,
UnrecoverableErrorHandler* error_handler) {
- // 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 =
+ SyncableService* app_sync_service =
profile_sync_service->profile()->GetExtensionService();
sync_api::UserShare* user_share = profile_sync_service->GetUserShare();
- AppModelAssociator* model_associator =
- new AppModelAssociator(extension_service, user_share);
- AppChangeProcessor* change_processor =
- new AppChangeProcessor(error_handler);
- return SyncComponents(model_associator, change_processor);
+ 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);
}
ProfileSyncFactory::SyncComponents
@@ -247,14 +237,17 @@ ProfileSyncFactory::SyncComponents
ProfileSyncFactoryImpl::CreateExtensionSyncComponents(
ProfileSyncService* profile_sync_service,
UnrecoverableErrorHandler* error_handler) {
- ExtensionServiceInterface* extension_service =
+ SyncableService* extension_sync_service =
profile_sync_service->profile()->GetExtensionService();
sync_api::UserShare* user_share = profile_sync_service->GetUserShare();
- ExtensionModelAssociator* model_associator =
- new ExtensionModelAssociator(extension_service, user_share);
- ExtensionChangeProcessor* change_processor =
- new ExtensionChangeProcessor(error_handler);
- return SyncComponents(model_associator, change_processor);
+ 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);
}
ProfileSyncFactory::SyncComponents
« no previous file with comments | « chrome/browser/sync/glue/extension_util_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698