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

Side by Side Diff: content/shell/renderer/test_runner/EventSender.cpp

Issue 140973005: Chrome allows WebTouchPoint to store WebFloatPoint, instead of WebPoint. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use static_cast. Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_widget.cc ('k') | content/shell/renderer/test_runner/TestPlugin.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 960
961 result->setNull(); 961 result->setNull();
962 } 962 }
963 963
964 void EventSender::addTouchPoint(const CppArgumentList& arguments, CppVariant* re sult) 964 void EventSender::addTouchPoint(const CppArgumentList& arguments, CppVariant* re sult)
965 { 965 {
966 result->setNull(); 966 result->setNull();
967 967
968 WebTouchPoint touchPoint; 968 WebTouchPoint touchPoint;
969 touchPoint.state = WebTouchPoint::StatePressed; 969 touchPoint.state = WebTouchPoint::StatePressed;
970 touchPoint.position = WebPoint(arguments[0].toInt32(), arguments[1].toInt32( )); 970 touchPoint.position.x = arguments[0].toInt32();
971 touchPoint.position.y = arguments[1].toInt32();
971 touchPoint.screenPosition = touchPoint.position; 972 touchPoint.screenPosition = touchPoint.position;
972 973
973 if (arguments.size() > 2) { 974 if (arguments.size() > 2) {
974 int radiusX = arguments[2].toInt32(); 975 int radiusX = arguments[2].toInt32();
975 int radiusY = radiusX; 976 int radiusY = radiusX;
976 if (arguments.size() > 3) 977 if (arguments.size() > 3)
977 radiusY = arguments[3].toInt32(); 978 radiusY = arguments[3].toInt32();
978 979
979 touchPoint.radiusX = radiusX; 980 touchPoint.radiusX = radiusX;
980 touchPoint.radiusY = radiusY; 981 touchPoint.radiusY = radiusY;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 touchModifiers &= ~mask; 1028 touchModifiers &= ~mask;
1028 } 1029 }
1029 1030
1030 void EventSender::updateTouchPoint(const CppArgumentList& arguments, CppVariant* result) 1031 void EventSender::updateTouchPoint(const CppArgumentList& arguments, CppVariant* result)
1031 { 1032 {
1032 result->setNull(); 1033 result->setNull();
1033 1034
1034 const unsigned index = arguments[0].toInt32(); 1035 const unsigned index = arguments[0].toInt32();
1035 BLINK_ASSERT(index < touchPoints.size()); 1036 BLINK_ASSERT(index < touchPoints.size());
1036 1037
1037 WebPoint position(arguments[1].toInt32(), arguments[2].toInt32());
1038 WebTouchPoint* touchPoint = &touchPoints[index]; 1038 WebTouchPoint* touchPoint = &touchPoints[index];
1039 touchPoint->state = WebTouchPoint::StateMoved; 1039 touchPoint->state = WebTouchPoint::StateMoved;
1040 touchPoint->position = position; 1040 touchPoint->position.x = arguments[1].toInt32();
1041 touchPoint->screenPosition = position; 1041 touchPoint->position.y = arguments[2].toInt32();
1042 touchPoint->screenPosition = touchPoint->position;
1042 } 1043 }
1043 1044
1044 void EventSender::cancelTouchPoint(const CppArgumentList& arguments, CppVariant* result) 1045 void EventSender::cancelTouchPoint(const CppArgumentList& arguments, CppVariant* result)
1045 { 1046 {
1046 result->setNull(); 1047 result->setNull();
1047 1048
1048 const unsigned index = arguments[0].toInt32(); 1049 const unsigned index = arguments[0].toInt32();
1049 BLINK_ASSERT(index < touchPoints.size()); 1050 BLINK_ASSERT(index < touchPoints.size());
1050 1051
1051 WebTouchPoint* touchPoint = &touchPoints[index]; 1052 WebTouchPoint* touchPoint = &touchPoints[index];
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 { 1431 {
1431 result->setNull(); 1432 result->setNull();
1432 } 1433 }
1433 1434
1434 void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result) 1435 void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result)
1435 { 1436 {
1436 result->setNull(); 1437 result->setNull();
1437 } 1438 }
1438 1439
1439 } 1440 }
OLDNEW
« no previous file with comments | « content/renderer/render_widget.cc ('k') | content/shell/renderer/test_runner/TestPlugin.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698