summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/go_button_gtk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/gtk/go_button_gtk.cc')
-rw-r--r--chrome/browser/gtk/go_button_gtk.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/gtk/go_button_gtk.cc b/chrome/browser/gtk/go_button_gtk.cc
index 81b8e52..e4606bb 100644
--- a/chrome/browser/gtk/go_button_gtk.cc
+++ b/chrome/browser/gtk/go_button_gtk.cc
@@ -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 @@ gboolean GoButtonGtk::OnQueryTooltip(GtkTooltip* tooltip) {
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();