Index: chrome/browser/profiles/profiles_state.cc |
diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc |
index 71c08c05ac8c8ef5b8bd97e55eff2fb68a9e61a3..3fc99154509fe31abda972aa134fc1d73d552c9d 100644 |
--- a/chrome/browser/profiles/profiles_state.cc |
+++ b/chrome/browser/profiles/profiles_state.cc |
@@ -9,6 +9,8 @@ |
#include "base/prefs/pref_service.h" |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/browser_process.h" |
+#include "chrome/browser/profiles/gaia_info_update_service.h" |
+#include "chrome/browser/profiles/gaia_info_update_service_factory.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_info_cache.h" |
#include "chrome/browser/profiles/profile_manager.h" |
@@ -17,6 +19,7 @@ |
#include "chrome/common/chrome_constants.h" |
#include "chrome/common/pref_names.h" |
#include "components/signin/core/browser/profile_oauth2_token_service.h" |
+#include "components/signin/core/common/profile_management_switches.h" |
#include "grit/generated_resources.h" |
#include "ui/base/l10n/l10n_util.h" |
@@ -109,4 +112,14 @@ bool IsRegularOrGuestSession(Browser* browser) { |
return profile->IsGuestSession() || !profile->IsOffTheRecord(); |
} |
+void UpdateGaiaProfilePhotoIfNeeded(Profile* profile) { |
+ // If the --google-profile-info flag isn't used, then the |
+ // GAIAInfoUpdateService isn't initialized, and we can't download the picture. |
+ if (!switches::IsGoogleProfileInfo()) |
+ return; |
+ |
+ DCHECK(profile); |
+ GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update(); |
+} |
+ |
} // namespace profiles |