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

Unified Diff: chrome/browser/ui/toolbar/wrench_menu_model.cc

Issue 9489011: Elide long emails in the wrench and profile menus. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed lint Created 8 years, 10 months 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
Index: chrome/browser/ui/toolbar/wrench_menu_model.cc
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 3edb4864a92d017285f096d2fd5f920c01275249..37186fd5039bb767a6b22d2cc8685fdae53c63b0 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -48,6 +48,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/button_menu_item_model.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/base/text/text_elider.h"
#include "ui/gfx/image/image.h"
#if defined(TOOLKIT_USES_GTK)
@@ -267,8 +268,11 @@ string16 WrenchMenuModel::GetLabelForCommandId(int command_id) const {
std::string username = browser_->GetProfile()->GetPrefs()->GetString(
prefs::kGoogleServicesUsername);
if (!username.empty()) {
+ string16 elided_username = ui::ElideEmail(
+ UTF8ToUTF16(username),
+ ui::kMaxProfileUsernameLength);
return l10n_util::GetStringFUTF16(IDS_SYNC_MENU_SYNCED_LABEL,
- UTF8ToUTF16(username));
+ elided_username);
}
}
return l10n_util::GetStringFUTF16(IDS_SYNC_MENU_PRE_SYNCED_LABEL,

Powered by Google App Engine
This is Rietveld 408576698