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

Unified Diff: chrome/browser/sync/sessions/session_data_type_controller.cc

Issue 1310553005: [Sync] Replace ProfileSyncComponentsFactory with SyncClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really fix GN Created 5 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
Index: chrome/browser/sync/sessions/session_data_type_controller.cc
diff --git a/chrome/browser/sync/sessions/session_data_type_controller.cc b/chrome/browser/sync/sessions/session_data_type_controller.cc
index 9eb90ae42d2e9d17e60a38df745c3bacd7f1621f..3c1a660d304844d61a958a00ac66864b16fd7469 100644
--- a/chrome/browser/sync/sessions/session_data_type_controller.cc
+++ b/chrome/browser/sync/sessions/session_data_type_controller.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/sync/glue/synced_window_delegate.h"
#include "chrome/browser/sync/sessions/synced_window_delegates_getter.h"
#include "chrome/common/pref_names.h"
+#include "components/sync_driver/sync_client.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
@@ -21,7 +22,7 @@ using content::BrowserThread;
namespace browser_sync {
SessionDataTypeController::SessionDataTypeController(
- sync_driver::SyncApiComponentFactory* sync_factory,
+ sync_driver::SyncClient* sync_client,
Profile* profile,
SyncedWindowDelegatesGetter* synced_window_getter,
sync_driver::LocalDeviceInfoProvider* local_device)
@@ -29,14 +30,15 @@ SessionDataTypeController::SessionDataTypeController(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
base::Bind(&ChromeReportUnrecoverableError),
syncer::SESSIONS,
- sync_factory),
+ sync_client),
+ sync_client_(sync_client),
profile_(profile),
synced_window_getter_(synced_window_getter),
local_device_(local_device),
waiting_on_session_restore_(false),
waiting_on_local_device_info_(false) {
DCHECK(local_device_);
- pref_registrar_.Init(profile->GetPrefs());
+ pref_registrar_.Init(sync_client_->GetPrefService());
pref_registrar_.Add(
prefs::kSavingBrowserHistoryDisabled,
base::Bind(&SessionDataTypeController::OnSavingBrowserHistoryPrefChanged,
@@ -78,7 +80,7 @@ void SessionDataTypeController::StopModels() {
bool SessionDataTypeController::ReadyForStart() const {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- return !profile_->GetPrefs()->GetBoolean(
+ return !sync_client_->GetPrefService()->GetBoolean(
prefs::kSavingBrowserHistoryDisabled);
}
@@ -115,7 +117,8 @@ void SessionDataTypeController::OnLocalDeviceInfoInitialized() {
void SessionDataTypeController::OnSavingBrowserHistoryPrefChanged() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (profile_->GetPrefs()->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) {
+ if (sync_client_->GetPrefService()->GetBoolean(
+ prefs::kSavingBrowserHistoryDisabled)) {
// If history and tabs persistence is turned off then generate an
// unrecoverable error. SESSIONS won't be a registered type on the next
// Chrome restart.

Powered by Google App Engine
This is Rietveld 408576698