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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.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
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_login_handler.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/ntp_login_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
index 16ff75ac73bc22470c52c986a028ec0524a7976f..b1f62c4eb13e36b22d771d6b1b68b61ee1f297a5 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -86,10 +86,6 @@ NTPLoginHandler::~NTPLoginHandler() {
void NTPLoginHandler::RegisterMessages() {
PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs();
- username_pref_.Init(prefs::kGoogleServicesUsername,
- pref_service,
- base::Bind(&NTPLoginHandler::UpdateLogin,
- base::Unretained(this)));
signin_allowed_pref_.Init(prefs::kSigninAllowed,
pref_service,
base::Bind(&NTPLoginHandler::UpdateLogin,
@@ -125,8 +121,8 @@ void NTPLoginHandler::HandleInitializeSyncLogin(const base::ListValue* args) {
void NTPLoginHandler::HandleShowSyncLoginUI(const base::ListValue* args) {
Profile* profile = Profile::FromWebUI(web_ui());
- std::string username = profile->GetPrefs()->GetString(
- prefs::kGoogleServicesUsername);
+ std::string username =
+ SigninManagerFactory::GetForProfile(profile)->GetAuthenticatedUsername();
content::WebContents* web_contents = web_ui()->GetWebContents();
Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
if (!browser)
@@ -195,8 +191,8 @@ void NTPLoginHandler::HandleShowAdvancedLoginUI(const base::ListValue* args) {
void NTPLoginHandler::UpdateLogin() {
Profile* profile = Profile::FromWebUI(web_ui());
- std::string username = profile->GetPrefs()->GetString(
- prefs::kGoogleServicesUsername);
+ std::string username =
+ SigninManagerFactory::GetForProfile(profile)->GetAuthenticatedUsername();
base::string16 header, sub_header;
std::string icon_url;
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_login_handler.h ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698