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

Unified Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 10808083: gesture recognizer: Expose bounding-box for the points in a gesture-event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 8 years, 5 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 | content/browser/renderer_host/web_input_event_aurax11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_win.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc
index d6dcddd16aa9c767bf2628e576b67a27b488a339..9149c239a8dc25a2187b72008953838d81bb8470 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -400,15 +400,13 @@ class LocalGestureEvent :
public:
LocalGestureEvent(
HWND hwnd,
- ui::EventType type,
+ const ui::GestureEventDetails& details,
const gfx::Point& location,
int flags,
base::Time time,
- float param_first,
- float param_second,
unsigned int touch_id_bitfield)
: touch_ids_bitfield_(touch_id_bitfield),
- type_(type) {
+ type_(details.type()) {
// location is given in window coordinates, based on the parent window.
// Map to the appropriate window's coordinates. For a root window the
// coordinates won't change, because the parent shares our rect.
@@ -420,9 +418,19 @@ class LocalGestureEvent :
data().y = client_point.y;
data().globalX = screen_point.x;
data().globalY = screen_point.y;
- data().deltaX = param_first;
- data().deltaY = param_second;
- data().type = ConvertToWebInputEvent(type);
+ data().deltaX = details.generic_x();
+ data().deltaY = details.generic_y();
+ data().type = ConvertToWebInputEvent(type_);
+
+ // WebKit gesture events do not have bounding-boxes yet, and expect the data
+ // in deltaX/deltaY instead (and instead of bounding box, WebKit expects the
+ // radius). This is currently used only for tap events. So special case this
+ // particular case.
+ // http://crbug.com/138572
+ if (type_ == ui::ET_GESTURE_TAP) {
+ data().deltaX = details.bounding_box().width() / 2;
+ data().deltaY = details.bounding_box().height() / 2;
+ }
}
virtual int GetLowestTouchId() const OVERRIDE {
@@ -1287,9 +1295,8 @@ ui::GestureEvent* RenderWidgetHostViewWin::CreateGestureEvent(
int flags,
base::Time time,
unsigned int touch_id_bitfield) {
-
- return new LocalGestureEvent(m_hWnd, details.type(), location, flags, time,
- details.generic_x(), details.generic_y(), touch_id_bitfield);
+ return new LocalGestureEvent(m_hWnd, details, location, flags, time,
+ touch_id_bitfield);
}
ui::TouchEvent* RenderWidgetHostViewWin::CreateTouchEvent(
« no previous file with comments | « no previous file | content/browser/renderer_host/web_input_event_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698