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

Unified Diff: chrome/browser/profiles/profiles_state.cc

Issue 566933005: Do not display lock for hosted domains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ChromeOS test - part deux Created 6 years, 3 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
« no previous file with comments | « chrome/browser/profiles/profiles_state.h ('k') | chrome/browser/signin/signin_manager_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profiles_state.cc
diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc
index 2a254993e1c8b363d3941bca7913cca7cdcfb58a..bcef38c0c2d5bbdb95e5e83b7b05d0370259f24c 100644
--- a/chrome/browser/profiles/profiles_state.cc
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -140,14 +140,30 @@ bool IsRegularOrGuestSession(Browser* browser) {
return profile->IsGuestSession() || !profile->IsOffTheRecord();
}
-void UpdateGaiaProfilePhotoIfNeeded(Profile* profile) {
+void UpdateIsProfileLockEnabledIfNeeded(Profile* profile) {
+ DCHECK(switches::IsNewProfileManagement());
+
+ if (!profile->GetPrefs()->GetString(prefs::kGoogleServicesHostedDomain).
+ empty())
+ return;
+
+ UpdateGaiaProfileInfoIfNeeded(profile);
+}
+
+void UpdateGaiaProfileInfoIfNeeded(Profile* profile) {
// If the --google-profile-info flag isn't used, then the
- // GAIAInfoUpdateService isn't initialized, and we can't download the picture.
+ // GAIAInfoUpdateService isn't initialized, and we can't download the profile
+ // info.
if (!switches::IsGoogleProfileInfo())
return;
DCHECK(profile);
- GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update();
+
+ GAIAInfoUpdateService* service =
+ GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile);
+ // The service may be null, for example during unit tests.
+ if (service)
+ service->Update();
}
SigninErrorController* GetSigninErrorController(Profile* profile) {
« no previous file with comments | « chrome/browser/profiles/profiles_state.h ('k') | chrome/browser/signin/signin_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698