OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // This file contains the definition for EventSender. | 5 // This file contains the definition for EventSender. |
6 // | 6 // |
7 // Some notes about drag and drop handling: | 7 // Some notes about drag and drop handling: |
8 // Windows drag and drop goes through a system call to doDragDrop. At that | 8 // Windows drag and drop goes through a system call to doDragDrop. At that |
9 // point, program control is given to Windows which then periodically makes | 9 // point, program control is given to Windows which then periodically makes |
10 // callbacks into the webview. This won't work for layout tests, so instead, | 10 // callbacks into the webview. This won't work for layout tests, so instead, |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 | 983 |
984 result->setNull(); | 984 result->setNull(); |
985 } | 985 } |
986 | 986 |
987 void EventSender::addTouchPoint(const CppArgumentList& arguments, CppVariant* re
sult) | 987 void EventSender::addTouchPoint(const CppArgumentList& arguments, CppVariant* re
sult) |
988 { | 988 { |
989 result->setNull(); | 989 result->setNull(); |
990 | 990 |
991 WebTouchPoint touchPoint; | 991 WebTouchPoint touchPoint; |
992 touchPoint.state = WebTouchPoint::StatePressed; | 992 touchPoint.state = WebTouchPoint::StatePressed; |
993 touchPoint.position.x = arguments[0].toInt32(); | 993 touchPoint.position = WebFloatPoint(arguments[0].toInt32(), arguments[1].toI
nt32()); |
994 touchPoint.position.y = arguments[1].toInt32(); | |
995 touchPoint.screenPosition = touchPoint.position; | 994 touchPoint.screenPosition = touchPoint.position; |
996 | 995 |
997 if (arguments.size() > 2) { | 996 if (arguments.size() > 2) { |
998 int radiusX = arguments[2].toInt32(); | 997 int radiusX = arguments[2].toInt32(); |
999 int radiusY = radiusX; | 998 int radiusY = radiusX; |
1000 if (arguments.size() > 3) | 999 if (arguments.size() > 3) |
1001 radiusY = arguments[3].toInt32(); | 1000 radiusY = arguments[3].toInt32(); |
1002 | 1001 |
1003 touchPoint.radiusX = radiusX; | 1002 touchPoint.radiusX = radiusX; |
1004 touchPoint.radiusY = radiusY; | 1003 touchPoint.radiusY = radiusY; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 | 1052 |
1054 void EventSender::updateTouchPoint(const CppArgumentList& arguments, CppVariant*
result) | 1053 void EventSender::updateTouchPoint(const CppArgumentList& arguments, CppVariant*
result) |
1055 { | 1054 { |
1056 result->setNull(); | 1055 result->setNull(); |
1057 | 1056 |
1058 const unsigned index = arguments[0].toInt32(); | 1057 const unsigned index = arguments[0].toInt32(); |
1059 BLINK_ASSERT(index < touchPoints.size()); | 1058 BLINK_ASSERT(index < touchPoints.size()); |
1060 | 1059 |
1061 WebTouchPoint* touchPoint = &touchPoints[index]; | 1060 WebTouchPoint* touchPoint = &touchPoints[index]; |
1062 touchPoint->state = WebTouchPoint::StateMoved; | 1061 touchPoint->state = WebTouchPoint::StateMoved; |
1063 touchPoint->position.x = arguments[1].toInt32(); | 1062 touchPoint->position = WebFloatPoint(arguments[1].toInt32(), arguments[2].to
Int32()); |
1064 touchPoint->position.y = arguments[2].toInt32(); | |
1065 touchPoint->screenPosition = touchPoint->position; | 1063 touchPoint->screenPosition = touchPoint->position; |
1066 } | 1064 } |
1067 | 1065 |
1068 void EventSender::cancelTouchPoint(const CppArgumentList& arguments, CppVariant*
result) | 1066 void EventSender::cancelTouchPoint(const CppArgumentList& arguments, CppVariant*
result) |
1069 { | 1067 { |
1070 result->setNull(); | 1068 result->setNull(); |
1071 | 1069 |
1072 const unsigned index = arguments[0].toInt32(); | 1070 const unsigned index = arguments[0].toInt32(); |
1073 BLINK_ASSERT(index < touchPoints.size()); | 1071 BLINK_ASSERT(index < touchPoints.size()); |
1074 | 1072 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 { | 1456 { |
1459 result->setNull(); | 1457 result->setNull(); |
1460 } | 1458 } |
1461 | 1459 |
1462 void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result) | 1460 void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result) |
1463 { | 1461 { |
1464 result->setNull(); | 1462 result->setNull(); |
1465 } | 1463 } |
1466 | 1464 |
1467 } | 1465 } |
OLD | NEW |