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

Unified Diff: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc

Issue 6840068: GTK: Add Recently Closed tabs to the History menu in the global menu bar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove current most visited section. will redo with TopSites in a different patch. Created 9 years, 8 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/gtk/browser_window_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
index 961e7f14452d479e7e6d643feb849dfbafc4f2ed..07d4a4abce050fb9c0e9019ef07d5125142c2c88 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
@@ -34,10 +34,6 @@ const int kBitsInAByte = 8;
// Maximum number of characters on a bookmark button.
const size_t kMaxCharsOnAButton = 15;
-// Max size of each component of the button tooltips.
-const size_t kMaxTooltipTitleLength = 100;
-const size_t kMaxTooltipURLLength = 400;
-
// Padding between the chrome button highlight border and the contents (favicon,
// text).
const int kButtonPaddingTop = 0;
@@ -245,32 +241,7 @@ std::string BuildTooltipFor(const BookmarkNode* node) {
if (node->is_folder())
return std::string();
- const std::string& url = node->GetURL().possibly_invalid_spec();
- const std::string& title = UTF16ToUTF8(node->GetTitle());
-
- std::string truncated_url = UTF16ToUTF8(l10n_util::TruncateString(
- UTF8ToUTF16(url), kMaxTooltipURLLength));
- gchar* escaped_url_cstr = g_markup_escape_text(truncated_url.c_str(),
- truncated_url.size());
- std::string escaped_url(escaped_url_cstr);
- g_free(escaped_url_cstr);
-
- std::string tooltip;
- if (url == title || title.empty()) {
- return escaped_url;
- } else {
- std::string truncated_title = UTF16ToUTF8(l10n_util::TruncateString(
- node->GetTitle(), kMaxTooltipTitleLength));
- gchar* escaped_title_cstr = g_markup_escape_text(truncated_title.c_str(),
- truncated_title.size());
- std::string escaped_title(escaped_title_cstr);
- g_free(escaped_title_cstr);
-
- if (!escaped_url.empty())
- return std::string("<b>") + escaped_title + "</b>\n" + escaped_url;
- else
- return std::string("<b>") + escaped_title + "</b>";
- }
+ return gtk_util::BuildTooltipTitleFor(node->GetTitle(), node->GetURL());
}
const BookmarkNode* BookmarkNodeForWidget(GtkWidget* widget) {
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/gtk/browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698