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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 60443002: Fixing problem with user image in settings page when page gets called as visiting window on a multi… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: As discussed - for security added empty check Created 7 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index f8840fa21a5e6ebc02fd6492051c0b879f3ef662..bb307f75c5cc3785423226408a6af9d998f4ac00 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -80,6 +80,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/common/page_zoom.h"
+#include "google_apis/gaia/gaia_auth_util.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -467,8 +468,10 @@ void BrowserOptionsHandler::GetLocalizedValues(DictionaryValue* values) {
l10n_util::GetStringFUTF16(IDS_SEARCH_PREF_EXPLANATION, omnibox_url));
#if defined(OS_CHROMEOS)
- const chromeos::User* user = chromeos::UserManager::Get()->GetLoggedInUser();
- values->SetString("username", user ? user->email() : std::string());
+ Profile* profile = Profile::FromWebUI(web_ui());
+ std::string name = profile->GetProfileName();
+ values->SetString("username", name.empty() ? name :
James Hawkins 2013/11/05 18:51:44 Optional nit: Might be more readable to the latter
Mr4D (OOO till 08-26) 2013/11/05 19:07:08 Not quite sure if it is better readable, but done.
+ gaia::SanitizeEmail(gaia::CanonicalizeEmail(name)));
#endif
// Pass along sync status early so it will be available during page init.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698