Commit 32a9879f authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Prefer SyncService over ProfileSyncService in foreign_session_helper

SyncService is the interface, ProfileSyncService is the concrete
implementation. Generally no clients should need to use the conrete
implementation - for one, testing will be much easier once everyone
uses the interface only.

Bug: 924508
Change-Id: Ia210665f8f02512053d1a60d627dea0f22758387
Reviewed-on: https://chromium-review.googlesource.com/c/1461119
Auto-Submit: Marc Treib <treib@chromium.org>
Commit-Queue: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630662}
parent 8b4b4f62
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
#include "chrome/browser/ui/android/tab_model/tab_model_list.h" #include "chrome/browser/ui/android/tab_model/tab_model_list.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "components/browser_sync/profile_sync_service.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h" #include "components/prefs/scoped_user_pref_update.h"
#include "components/sync/driver/sync_service.h"
#include "components/sync_sessions/open_tabs_ui_delegate.h" #include "components/sync_sessions/open_tabs_ui_delegate.h"
#include "components/sync_sessions/session_sync_service.h" #include "components/sync_sessions/session_sync_service.h"
#include "content/public/browser/notification_details.h" #include "content/public/browser/notification_details.h"
...@@ -181,13 +181,12 @@ jboolean ForeignSessionHelper::IsTabSyncEnabled( ...@@ -181,13 +181,12 @@ jboolean ForeignSessionHelper::IsTabSyncEnabled(
void ForeignSessionHelper::TriggerSessionSync( void ForeignSessionHelper::TriggerSessionSync(
JNIEnv* env, JNIEnv* env,
const JavaParamRef<jobject>& obj) { const JavaParamRef<jobject>& obj) {
browser_sync::ProfileSyncService* service = syncer::SyncService* service =
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_); ProfileSyncServiceFactory::GetSyncServiceForProfile(profile_);
if (!service) if (!service)
return; return;
const syncer::ModelTypeSet types(syncer::SESSIONS); service->TriggerRefresh({syncer::SESSIONS});
service->TriggerRefresh(types);
} }
void ForeignSessionHelper::SetOnForeignSessionCallback( void ForeignSessionHelper::SetOnForeignSessionCallback(
...@@ -309,8 +308,8 @@ void ForeignSessionHelper::SetInvalidationsForSessionsEnabled( ...@@ -309,8 +308,8 @@ void ForeignSessionHelper::SetInvalidationsForSessionsEnabled(
JNIEnv* env, JNIEnv* env,
const JavaParamRef<jobject>& obj, const JavaParamRef<jobject>& obj,
jboolean enabled) { jboolean enabled) {
browser_sync::ProfileSyncService* service = syncer::SyncService* service =
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_); ProfileSyncServiceFactory::GetSyncServiceForProfile(profile_);
if (!service) if (!service)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment