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

Unified Diff: chrome/browser/gtk/go_button_gtk.cc

Issue 175004: Ellipsize long entries in bookmark menus and the back/forward menus.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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/gtk/go_button_gtk.cc
===================================================================
--- chrome/browser/gtk/go_button_gtk.cc (revision 24583)
+++ chrome/browser/gtk/go_button_gtk.cc (working copy)
@@ -19,6 +19,10 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
+// Limit the length of the tooltip text. This applies only to the text in the
+// omnibox (e.g. X in "Go to X");
+const size_t kMaxTooltipTextLength = 400;
+
GoButtonGtk::GoButtonGtk(LocationBarViewGtk* location_bar, Browser* browser)
: location_bar_(location_bar),
browser_(browser),
@@ -193,7 +197,8 @@
std::wstring current_text_wstr(location_bar_->location_entry()->GetText());
if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
l10n_util::WrapStringWithLTRFormatting(&current_text_wstr);
- string16 current_text = WideToUTF16Hack(current_text_wstr);
+ string16 current_text = WideToUTF16Hack(
+ l10n_util::TruncateString(current_text_wstr, kMaxTooltipTextLength));
AutocompleteEditModel* edit_model =
location_bar_->location_entry()->model();

Powered by Google App Engine
This is Rietveld 408576698