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

Unified Diff: chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: inlines Created 8 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
Index: chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc
diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc
index bfb1a1077c92547e238b5ebe0650344dd1b2c3cf..9d262aca08e8158249454e26812f6af6df08a1c7 100644
--- a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc
@@ -505,9 +505,9 @@ void DraggedTabControllerGtk::Detach() {
gfx::Point DraggedTabControllerGtk::ConvertScreenPointToTabStripPoint(
TabStripGtk* tabstrip, const gfx::Point& screen_point) {
- gfx::Point tabstrip_screen_point =
- ui::GetWidgetScreenPosition(tabstrip->tabstrip_.get());
- return screen_point.Subtract(tabstrip_screen_point);
+ gfx::Vector2d tabstrip_screen_offset =
+ ui::GetWidgetScreenOffset(tabstrip->tabstrip_.get());
Peter Kasting 2012/10/29 23:06:33 Nit: Inline into next statement
danakj 2012/10/29 23:21:41 Done.
+ return screen_point - tabstrip_screen_offset;
}
gfx::Rect DraggedTabControllerGtk::GetDraggedViewTabStripBounds(
@@ -817,8 +817,7 @@ gfx::Rect DraggedTabControllerGtk::GetAnimateBounds() {
gfx::Rect bounds = tab->GetRequisition();
GtkWidget* widget = tab->widget();
GtkWidget* parent = gtk_widget_get_parent(widget);
- gfx::Point point = ui::GetWidgetScreenPosition(parent);
- bounds.Offset(point);
+ bounds.Offset(ui::GetWidgetScreenOffset(parent));
return gfx::Rect(bounds.x(), bounds.y(),
dragged_view_->GetTotalWidthInTabStrip(), bounds.height());

Powered by Google App Engine
This is Rietveld 408576698