Chromium Code Reviews| Index: chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc |
| diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc |
| index a785d9d3d505a8b8fd10305b0d277614afc7afc3..8e8c1b85bcf361ec4366de06aa527bc97ac61c54 100644 |
| --- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc |
| +++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc |
| @@ -93,15 +93,15 @@ const int kCloseButtonHorzFuzz = 4; |
| // Gets the bounds of |widget| relative to |parent|. |
| gfx::Rect GetWidgetBoundsRelativeToParent(GtkWidget* parent, |
| GtkWidget* widget) { |
| - gfx::Point parent_pos = ui::GetWidgetScreenPosition(parent); |
| - gfx::Point widget_pos = ui::GetWidgetScreenPosition(widget); |
| + gfx::Vector2d parent_offset = ui::GetWidgetScreenOffset(parent); |
| + gfx::Vector2d widget_offset = ui::GetWidgetScreenOffset(widget); |
| + gfx::Vector2d offset_from_parent = widget_offset - parent_offset; |
| GtkAllocation allocation; |
| gtk_widget_get_allocation(widget, &allocation); |
| - return gfx::Rect(widget_pos.x() - parent_pos.x(), |
| - widget_pos.y() - parent_pos.y(), |
| - allocation.width, allocation.height); |
| + return gfx::Rect(gfx::PointAtOffsetFromOrigin(offset_from_parent), |
| + gfx::Size(allocation.width, allocation.height)); |
|
Peter Kasting
2012/10/29 23:06:33
Nit: Assuming your earlier use of GetWidgetScreenB
danakj
2012/10/29 23:21:41
Done.
|
| } |
| } // namespace |