Chromium Code Reviews| 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, |