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

Unified Diff: chrome/browser/views/bookmark_bar_view.cc

Issue 197031: Fleshes out the tooltip implementation for views on Gtk. It doesn't... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | « no previous file | chrome/browser/views/toolbar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/bookmark_bar_view.cc
===================================================================
--- chrome/browser/views/bookmark_bar_view.cc (revision 25502)
+++ chrome/browser/views/bookmark_bar_view.cc (working copy)
@@ -43,11 +43,6 @@
#include "views/widget/widget.h"
#include "views/window/window.h"
-#if defined(OS_WIN)
-#include "app/win_util.h"
-#include "base/base_drag_source.h"
-#endif
-
using views::CustomButton;
using views::DropTargetEvent;
using views::MenuButton;
@@ -141,13 +136,8 @@
const GURL& url,
const std::wstring& title,
const std::wstring& languages) {
-#if defined(OS_WIN)
- gfx::Rect monitor_bounds = win_util::GetMonitorBoundsForRect(
- gfx::Rect(screen_loc.x(), screen_loc.y(), 1, 1));
-#else
- gfx::Rect monitor_bounds(0, 0, 10000, 10000);
- NOTIMPLEMENTED();
-#endif
+ int max_width = views::TooltipManager::GetMaxWidth(screen_loc.x(),
+ screen_loc.y());
gfx::Font tt_font = views::TooltipManager::GetDefaultFont();
std::wstring result;
@@ -155,11 +145,9 @@
if (!title.empty()) {
std::wstring localized_title;
if (l10n_util::AdjustStringForLocaleDirection(title, &localized_title))
- result.append(gfx::ElideText(localized_title,
- tt_font,
- monitor_bounds.width()));
+ result.append(gfx::ElideText(localized_title, tt_font, max_width));
else
- result.append(gfx::ElideText(title, tt_font, monitor_bounds.width()));
+ result.append(gfx::ElideText(title, tt_font, max_width));
}
// Only show the URL if the url and title differ.
@@ -173,10 +161,7 @@
// "/http://www.yahoo.com" when rendered, as is, in an RTL context since
// the Unicode BiDi algorithm puts certain characters on the left by
// default.
- std::wstring elided_url(gfx::ElideUrl(url,
- tt_font,
- monitor_bounds.width(),
- languages));
+ std::wstring elided_url(gfx::ElideUrl(url, tt_font, max_width, languages));
if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
l10n_util::WrapStringWithLTRFormatting(&elided_url);
result.append(elided_url);
« no previous file with comments | « no previous file | chrome/browser/views/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698