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

Unified Diff: chrome/browser/automation/testing_automation_provider_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: RenderText fixup 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/automation/testing_automation_provider_gtk.cc
diff --git a/chrome/browser/automation/testing_automation_provider_gtk.cc b/chrome/browser/automation/testing_automation_provider_gtk.cc
index 83f98433276d36270208a0dbaa80a368cd020f80..dd380a601050cd2dcf9255654d377950976b817c 100644
--- a/chrome/browser/automation/testing_automation_provider_gtk.cc
+++ b/chrome/browser/automation/testing_automation_provider_gtk.cc
@@ -35,16 +35,16 @@ void TestingAutomationProvider::WindowGetViewBounds(int handle,
GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation);
*bounds = gfx::Rect(allocation.width, allocation.height);
- gint x, y;
+ gfx::Point origin;
if (screen_coordinates) {
- gfx::Point point = ui::GetWidgetScreenPosition(widget);
- x = point.x();
- y = point.y();
+ origin = gfx::PointAtOffsetFromOrigin(ui::GetWidgetScreenOffset(widget));
} else {
+ gint x, y;
gtk_widget_translate_coordinates(widget, GTK_WIDGET(window),
0, 0, &x, &y);
+ origin = gfx::Point(x, y);
}
- bounds->set_origin(gfx::Point(x, y));
+ bounds->set_origin(origin);
}
}

Powered by Google App Engine
This is Rietveld 408576698