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

Unified Diff: chrome/browser/sync/glue/non_ui_data_type_controller.cc

Issue 317453002: sync: cut a few profile deps from DataTypeControllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move OnUserShareReady Created 6 years, 6 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
Index: chrome/browser/sync/glue/non_ui_data_type_controller.cc
diff --git a/chrome/browser/sync/glue/non_ui_data_type_controller.cc b/chrome/browser/sync/glue/non_ui_data_type_controller.cc
index a9a3b151f619af7dafc3c25d04d494a5851644d4..d10e4dc64b25ea493b366af02e40b6e0b7ed757b 100644
--- a/chrome/browser/sync/glue/non_ui_data_type_controller.cc
+++ b/chrome/browser/sync/glue/non_ui_data_type_controller.cc
@@ -6,11 +6,10 @@
#include "base/logging.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/sync/profile_sync_components_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "components/sync_driver/generic_change_processor_factory.h"
#include "components/sync_driver/shared_change_processor_ref.h"
+#include "components/sync_driver/sync_api_component_factory.h"
#include "content/public/browser/browser_thread.h"
#include "sync/api/sync_error.h"
#include "sync/api/syncable_service.h"
@@ -29,15 +28,12 @@ NonUIDataTypeController::CreateSharedChangeProcessor() {
NonUIDataTypeController::NonUIDataTypeController(
scoped_refptr<base::MessageLoopProxy> ui_thread,
const base::Closure& error_callback,
- ProfileSyncComponentsFactory* profile_sync_factory,
- Profile* profile,
+ SyncApiComponentFactory* sync_factory,
ProfileSyncService* sync_service)
: DataTypeController(ui_thread, error_callback),
- profile_sync_factory_(profile_sync_factory),
- profile_(profile),
sync_service_(sync_service),
- state_(NOT_RUNNING),
- user_share_(NULL) {
+ sync_factory_(sync_factory),
+ state_(NOT_RUNNING) {
}
void NonUIDataTypeController::LoadModels(
@@ -59,7 +55,6 @@ void NonUIDataTypeController::LoadModels(
DCHECK(!shared_change_processor_.get());
shared_change_processor_ = CreateSharedChangeProcessor();
DCHECK(shared_change_processor_.get());
- user_share_ = sync_service_->GetUserShare();
model_load_callback_ = model_load_callback;
if (!StartModels()) {
// If we are waiting for some external service to load before associating
@@ -162,10 +157,6 @@ void NonUIDataTypeController::Stop() {
break;
}
- // Deactivate the DataType on the UI thread. We dont want to listen
- // for any more changes or process them from the server.
- sync_service_->DeactivateDataType(type());
-
// Stop the local service and release our references to it and the
// shared change processor (posts a task to the datatype's thread).
StopLocalServiceAsync();
@@ -195,9 +186,7 @@ void NonUIDataTypeController::OnSingleDatatypeUnrecoverableError(
NonUIDataTypeController::NonUIDataTypeController()
: DataTypeController(base::MessageLoopProxy::current(), base::Closure()),
- profile_sync_factory_(NULL),
- profile_(NULL),
- sync_service_(NULL) {}
+ sync_service_(NULL), sync_factory_(NULL) {}
NonUIDataTypeController::~NonUIDataTypeController() {}
@@ -340,9 +329,9 @@ void NonUIDataTypeController::
// point on are through it.
GenericChangeProcessorFactory factory;
local_service_ = shared_change_processor->Connect(
- profile_sync_factory_,
+ sync_factory_,
&factory,
- user_share_,
+ user_share(),
this,
type(),
weak_ptr_factory.GetWeakPtr());

Powered by Google App Engine
This is Rietveld 408576698