OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Portions based heavily on: | 5 // Portions based heavily on: |
6 // third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.cpp | 6 // third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.cpp |
7 // | 7 // |
8 /* | 8 /* |
9 * Copyright (C) 2006-2011 Google Inc. All rights reserved. | 9 * Copyright (C) 2006-2011 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 gesture_event.type = WebKit::WebInputEvent::GestureTwoFingerTap; | 402 gesture_event.type = WebKit::WebInputEvent::GestureTwoFingerTap; |
403 break; | 403 break; |
404 case ui::ET_GESTURE_BEGIN: | 404 case ui::ET_GESTURE_BEGIN: |
405 case ui::ET_GESTURE_END: | 405 case ui::ET_GESTURE_END: |
406 case ui::ET_GESTURE_MULTIFINGER_SWIPE: | 406 case ui::ET_GESTURE_MULTIFINGER_SWIPE: |
407 break; | 407 break; |
408 default: | 408 default: |
409 NOTREACHED() << "Unknown gesture type: " << event->type(); | 409 NOTREACHED() << "Unknown gesture type: " << event->type(); |
410 } | 410 } |
411 | 411 |
| 412 gesture_event.boundingBox = event->details().bounding_box(); |
412 gesture_event.deltaX = event->details().generic_x(); | 413 gesture_event.deltaX = event->details().generic_x(); |
413 gesture_event.deltaY = event->details().generic_y(); | 414 gesture_event.deltaY = event->details().generic_y(); |
414 gesture_event.modifiers = EventFlagsToWebEventModifiers(event->flags()); | 415 gesture_event.modifiers = EventFlagsToWebEventModifiers(event->flags()); |
415 | 416 |
416 // WebKit gesture events do not have bounding-boxes yet, and expect the data | 417 // WebKit gesture events do not have bounding-boxes yet, and expect the data |
417 // in deltaX/deltaY instead (and instead of bounding box, WebKit expects the | 418 // in deltaX/deltaY instead (and instead of bounding box, WebKit expects the |
418 // radius). This is currently used only for tap events. So special case this | 419 // radius). This is currently used only for tap events. So special case this |
419 // particular case. | 420 // particular case. |
420 // http://crbug.com/138572 | 421 // http://crbug.com/138572 |
421 if (event->type() == ui::ET_GESTURE_TAP) { | 422 if (event->type() == ui::ET_GESTURE_TAP) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 492 |
492 // Update the type of the touch event. | 493 // Update the type of the touch event. |
493 web_event->type = TouchEventTypeFromEvent(event); | 494 web_event->type = TouchEventTypeFromEvent(event); |
494 web_event->timeStampSeconds = event->time_stamp().InSecondsF(); | 495 web_event->timeStampSeconds = event->time_stamp().InSecondsF(); |
495 web_event->modifiers = EventFlagsToWebEventModifiers(event->flags()); | 496 web_event->modifiers = EventFlagsToWebEventModifiers(event->flags()); |
496 | 497 |
497 return point; | 498 return point; |
498 } | 499 } |
499 | 500 |
500 } // namespace content | 501 } // namespace content |
OLD | NEW |