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

Unified Diff: chrome/browser/supervised_user/custodian_profile_downloader_service.cc

Issue 763673002: Replace direct access to kGoogleServicesUsername with calls to SigninManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr Created 6 years 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/supervised_user/custodian_profile_downloader_service.cc
diff --git a/chrome/browser/supervised_user/custodian_profile_downloader_service.cc b/chrome/browser/supervised_user/custodian_profile_downloader_service.cc
index 3955cef428326c0c6f9896464d7635c33f006bc6..a20f595310cfa64597ab2092567c028d09e3dcb8 100644
--- a/chrome/browser/supervised_user/custodian_profile_downloader_service.cc
+++ b/chrome/browser/supervised_user/custodian_profile_downloader_service.cc
@@ -6,7 +6,9 @@
#include "base/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/common/pref_names.h"
+#include "components/signin/core/browser/signin_manager.h"
#include "google_apis/gaia/gaia_auth_util.h"
CustodianProfileDownloaderService::CustodianProfileDownloaderService(
@@ -23,10 +25,10 @@ void CustodianProfileDownloaderService::Shutdown() {
void CustodianProfileDownloaderService::DownloadProfile(
const DownloadProfileCallback& callback) {
// The user must be logged in.
- std::string username = custodian_profile_->GetPrefs()->GetString(
- prefs::kGoogleServicesUsername);
- if (username.empty())
+ if (!SigninManagerFactory::GetForProfile(custodian_profile_)
+ ->IsAuthenticated()) {
return;
+ }
download_callback_ = callback;
std::string current_email = custodian_profile_->GetProfileName();

Powered by Google App Engine
This is Rietveld 408576698