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

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

Issue 326017: GTK: Compute infobubble rects correctly. (Closed)
Patch Set: Created 11 years, 2 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/browser/gtk/browser_actions_toolbar_gtk.cc ('k') | chrome/browser/gtk/toolbar_star_toggle_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/location_bar_view_gtk.cc
diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc
index 382563abdf028472e2fa6cc7dff3df53d8467779..086cf9745abb62cd0fc67c8a12678cd7883832ad 100644
--- a/chrome/browser/gtk/location_bar_view_gtk.cc
+++ b/chrome/browser/gtk/location_bar_view_gtk.cc
@@ -649,20 +649,23 @@ void LocationBarViewGtk::ShowFirstRunBubbleInternal(bool use_OEM_bubble) {
if (!location_entry_.get() || !widget()->window)
return;
- int x = widget()->allocation.x;
- int y = widget()->allocation.y;
+ gfx::Rect rect = gtk_util::GetWidgetRectRelativeToToplevel(widget());
+ rect.set_width(0);
+ rect.set_height(0);
// The bubble needs to be just below the Omnibox and slightly to the right
// of star button, so shift x and y co-ordinates.
- y += widget()->allocation.height + kFirstRunBubbleTopMargin;
+ int y_offset = widget()->allocation.height + kFirstRunBubbleTopMargin;
+ int x_offset = 0;
if (l10n_util::GetTextDirection() == l10n_util::LEFT_TO_RIGHT)
- x += kFirstRunBubbleLeftMargin;
+ x_offset = kFirstRunBubbleLeftMargin;
else
- x += widget()->allocation.width - kFirstRunBubbleLeftMargin;
+ x_offset = widget()->allocation.width - kFirstRunBubbleLeftMargin;
+ rect.Offset(x_offset, y_offset);
FirstRunBubble::Show(profile_,
GTK_WINDOW(gtk_widget_get_toplevel(widget())),
- gfx::Rect(x, y, 0, 0),
+ rect,
use_OEM_bubble);
}
« no previous file with comments | « chrome/browser/gtk/browser_actions_toolbar_gtk.cc ('k') | chrome/browser/gtk/toolbar_star_toggle_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698