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

Side by Side Diff: third_party/WebKit/Source/web/WebInputEventConversion.cpp

Issue 1892653003: Extract touch handling logic from EventHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/input/TouchEventManager.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 return WebTouchPoint::StateMoved; 447 return WebTouchPoint::StateMoved;
448 return WebTouchPoint::StateUndefined; 448 return WebTouchPoint::StateUndefined;
449 } 449 }
450 450
451 // TODO(mustaq): Add tests for this. 451 // TODO(mustaq): Add tests for this.
452 PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTo uchPoint& point) 452 PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTo uchPoint& point)
453 { 453 {
454 m_pointerProperties = point; 454 m_pointerProperties = point;
455 m_state = toPlatformTouchPointState(point.state); 455 m_state = toPlatformTouchPointState(point.state);
456 456
457 // This assumes convertFromRootFrame does only translations, not scales.
458 FloatPoint floatPos = convertHitPointToRootFrame(widget, point.position); 457 FloatPoint floatPos = convertHitPointToRootFrame(widget, point.position);
459 IntPoint flooredPoint = flooredIntPoint(floatPos); 458 IntPoint flooredPoint = flooredIntPoint(floatPos);
460 m_pos = widget->convertFromRootFrame(flooredPoint) + (floatPos - flooredPoin t); 459 m_pos = widget->convertFromRootFrame(flooredPoint) + (floatPos - flooredPoin t);
461 460
462 m_screenPos = FloatPoint(point.screenPosition.x, point.screenPosition.y); 461 m_screenPos = FloatPoint(point.screenPosition.x, point.screenPosition.y);
463 m_radius = scaleSizeToWindow(widget, FloatSize(point.radiusX, point.radiusY) ); 462 m_radius = scaleSizeToWindow(widget, FloatSize(point.radiusX, point.radiusY) );
464 m_rotationAngle = point.rotationAngle; 463 m_rotationAngle = point.rotationAngle;
465 } 464 }
466 465
467 PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTo uchEvent& event) 466 PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTo uchEvent& event)
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 break; 800 break;
802 case GestureSourceTouchscreen: 801 case GestureSourceTouchscreen:
803 sourceDevice = WebGestureDeviceTouchscreen; 802 sourceDevice = WebGestureDeviceTouchscreen;
804 break; 803 break;
805 case GestureSourceUninitialized: 804 case GestureSourceUninitialized:
806 NOTREACHED(); 805 NOTREACHED();
807 } 806 }
808 } 807 }
809 808
810 } // namespace blink 809 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/TouchEventManager.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698