Commit f5e809ae authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

ProfileSyncServiceAndroid: don't use SigninManager

SigninManager is an old API that's being deprecated.
Instead of querying the authenticated account from there, just get it
from ProfileSyncService directly.

Bug: 809032
Change-Id: I2ab9eca7facc94b78eea2474c3d9ea758658a3c1
Reviewed-on: https://chromium-review.googlesource.com/1016646Reviewed-by: default avatarJan Krcal <jkrcal@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551673}
parent 01cb67d6
......@@ -20,14 +20,13 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/common/channel_info.h"
#include "chrome/grit/generated_resources.h"
#include "components/browser_sync/profile_sync_service.h"
#include "components/prefs/pref_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/signin/core/browser/account_info.h"
#include "components/strings/grit/components_strings.h"
#include "components/sync/base/model_type.h"
#include "components/sync/base/pref_names.h"
......@@ -100,8 +99,7 @@ ProfileSyncServiceAndroid::ProfileSyncServiceAndroid(JNIEnv* env, jobject obj)
sync_prefs_ = std::make_unique<syncer::SyncPrefs>(profile_->GetPrefs());
sync_service_ =
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_);
sync_service_ = ProfileSyncServiceFactory::GetForProfile(profile_);
}
bool ProfileSyncServiceAndroid::Init() {
......@@ -452,9 +450,7 @@ ProfileSyncServiceAndroid::GetCurrentSignedInAccountText(
const JavaParamRef<jobject>&) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
const std::string& sync_username =
SigninManagerFactory::GetForProfile(profile_)
->GetAuthenticatedAccountInfo()
.email;
sync_service_->GetAuthenticatedAccountInfo().email;
return base::android::ConvertUTF16ToJavaString(
env, l10n_util::GetStringFUTF16(IDS_SYNC_ACCOUNT_INFO,
base::ASCIIToUTF16(sync_username)));
......
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