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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.cc

Issue 8822024: Profile/user menu on NTP should look more clickable? (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add profile-name class to 'username' Created 9 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/resources/ntp4/new_tab.css ('k') | no next file » | 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 dc7f087bd1a15199124028eac77cb0486d5d65d5..be9bb7538f528958c45a214e2a6e9133ab1de5f1 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -36,6 +36,7 @@
#include "content/public/browser/notification_service.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#include "net/base/escape.h"
#include "skia/ext/image_operations.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/canvas_skia.h"
@@ -184,21 +185,26 @@ void NTPLoginHandler::UpdateLogin() {
// case. In the multi-profile case the profile picture is visible in the
// title bar and the full name can be ambiguous.
if (cache.GetNumberOfProfiles() == 1) {
- header = cache.GetGAIANameOfProfileAtIndex(profile_index);
+ string16 name = cache.GetGAIANameOfProfileAtIndex(profile_index);
+ header = ASCIIToUTF16("<span class='profile-name'>") +
+ net::EscapeForHTML(name) +
+ ASCIIToUTF16("</span>");
const gfx::Image* image =
cache.GetGAIAPictureOfProfileAtIndex(profile_index);
if (image)
icon_url = web_ui_util::GetImageDataUrl(GetGAIAPictureForNTP(*image));
}
if (header.empty())
Evan Stade 2011/12/08 18:23:35 curlies
- header = UTF8ToUTF16(username);
+ header = UTF8ToUTF16("<span class='profile-name'>" +
+ net::EscapeForHTML(username) + "</span>");
}
} else if (SyncPromoUI::ShouldShowSyncPromo(profile) &&
(SyncPromoUI::UserHasSeenSyncPromoAtStartup(profile) ||
PromoResourceService::CanShowNTPSignInPromo(profile))) {
string16 signed_in_link = l10n_util::GetStringUTF16(
IDS_SYNC_PROMO_NOT_SIGNED_IN_STATUS_LINK);
- signed_in_link = ASCIIToUTF16("<span class='link-span'>") + signed_in_link +
+ signed_in_link = ASCIIToUTF16("<span class='link-span'>") +
+ net::EscapeForHTML(signed_in_link) +
ASCIIToUTF16("</span>");
header = l10n_util::GetStringFUTF16(
IDS_SYNC_PROMO_NOT_SIGNED_IN_STATUS_HEADER,
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698