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

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

Issue 9414020: [Sync] Switch Extension Settings DTC to use ProfilesyncComponentsFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove RunWithSyncableService and clean up Created 8 years, 10 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/extension_setting_data_type_controller.cc
diff --git a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc
index 08bfae170719c2746ca579b91f94439bd4761cc8..213f7958d8046bfa28f5372c920d0ff44f4aacca 100644
--- a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc
+++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc
@@ -6,8 +6,6 @@
#include "base/bind.h"
#include "base/metrics/histogram.h"
-#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/settings/settings_frontend.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/api/syncable_service.h"
#include "chrome/browser/sync/glue/generic_change_processor.h"
@@ -28,8 +26,7 @@ ExtensionSettingDataTypeController::ExtensionSettingDataTypeController(
profile_sync_service),
type_(type),
profile_(profile),
- profile_sync_service_(profile_sync_service),
- settings_service_(NULL) {
+ profile_sync_service_(profile_sync_service) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(type == syncable::EXTENSION_SETTINGS ||
type == syncable::APP_SETTINGS);
@@ -50,14 +47,7 @@ bool ExtensionSettingDataTypeController::PostTaskOnBackendThread(
const tracked_objects::Location& from_here,
const base::Closure& task) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(profile_->GetExtensionService());
- profile_->GetExtensionService()->settings_frontend()->RunWithSyncableService(
- type_,
- base::Bind(
- &ExtensionSettingDataTypeController::RunTaskOnBackendThread,
- this,
- task));
- return true;
+ return BrowserThread::PostTask(BrowserThread::FILE, from_here, task);
}
bool ExtensionSettingDataTypeController::StartModels() {
@@ -69,10 +59,9 @@ bool ExtensionSettingDataTypeController::StartModels() {
void ExtensionSettingDataTypeController::CreateSyncComponents() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK_EQ(state(), ASSOCIATING);
- DCHECK(settings_service_);
ProfileSyncComponentsFactory::SyncComponents sync_components =
profile_sync_factory()->CreateExtensionOrAppSettingSyncComponents(
- type_, settings_service_, profile_sync_service_, this);
+ type_, profile_sync_service_, this);
set_model_associator(sync_components.model_associator);
set_change_processor(sync_components.change_processor);
}
@@ -94,13 +83,4 @@ void ExtensionSettingDataTypeController::RecordStartFailure(
"Sync.ExtensionSettingStartFailures", result, MAX_START_RESULT);
}
-void ExtensionSettingDataTypeController::RunTaskOnBackendThread(
- const base::Closure& task,
- SyncableService* settings_service) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- // Store |settings_service| so that |task| can use it.
- settings_service_ = settings_service;
- task.Run();
-}
-
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698