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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 750013004: Added experimental tilt and tiltDirection to the Touch interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed WebInputEventConversionTest Created 5 years, 9 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 | « Source/core/dom/Touch.idl ('k') | Source/platform/PlatformTouchPoint.h » ('j') | 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) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 3759 matching lines...) Expand 10 before | Expand all | Expand 10 after
3770 // pagePoint should always be relative to the target elements 3770 // pagePoint should always be relative to the target elements
3771 // containing frame. 3771 // containing frame.
3772 FloatPoint pagePoint = targetFrame->view()->windowToContents(point.pos() ); 3772 FloatPoint pagePoint = targetFrame->view()->windowToContents(point.pos() );
3773 3773
3774 float scaleFactor = 1.0f / targetFrame->pageZoomFactor(); 3774 float scaleFactor = 1.0f / targetFrame->pageZoomFactor();
3775 3775
3776 FloatPoint adjustedPagePoint = pagePoint.scaledBy(scaleFactor); 3776 FloatPoint adjustedPagePoint = pagePoint.scaledBy(scaleFactor);
3777 FloatSize adjustedRadius = point.radius().scaledBy(scaleFactor); 3777 FloatSize adjustedRadius = point.radius().scaledBy(scaleFactor);
3778 3778
3779 RefPtrWillBeRawPtr<Touch> touch = Touch::create( 3779 RefPtrWillBeRawPtr<Touch> touch = Touch::create(
3780 targetFrame, touchTarget.get(), point.id(), point.screenPos(), adjus tedPagePoint, adjustedRadius, point.rotationAngle(), point.force()); 3780 targetFrame, touchTarget.get(), point.id(), point.screenPos(), adjus tedPagePoint, adjustedRadius, point.rotationAngle(), point.force(), point.tilt() , point.tiltDirection());
3781 3781
3782 // Ensure this target's touch list exists, even if it ends up empty, so 3782 // Ensure this target's touch list exists, even if it ends up empty, so
3783 // it can always be passed to TouchEvent::Create below. 3783 // it can always be passed to TouchEvent::Create below.
3784 TargetTouchesHeapMap::iterator targetTouchesIterator = touchesByTarget.f ind(touchTarget.get()); 3784 TargetTouchesHeapMap::iterator targetTouchesIterator = touchesByTarget.f ind(touchTarget.get());
3785 if (targetTouchesIterator == touchesByTarget.end()) { 3785 if (targetTouchesIterator == touchesByTarget.end()) {
3786 touchesByTarget.set(touchTarget.get(), TouchList::create()); 3786 touchesByTarget.set(touchTarget.get(), TouchList::create());
3787 targetTouchesIterator = touchesByTarget.find(touchTarget.get()); 3787 targetTouchesIterator = touchesByTarget.find(touchTarget.get());
3788 } 3788 }
3789 3789
3790 // touches and targetTouches should only contain information about 3790 // touches and targetTouches should only contain information about
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
3952 3952
3953 // If it's in the direction to hide the top controls, only consume when the frame can also scroll. 3953 // If it's in the direction to hide the top controls, only consume when the frame can also scroll.
3954 if (m_frame->view()->scrollPosition().y() < m_frame->view()->maximumScrollPo sition().y()) 3954 if (m_frame->view()->scrollPosition().y() < m_frame->view()->maximumScrollPo sition().y())
3955 return true; 3955 return true;
3956 3956
3957 return false; 3957 return false;
3958 } 3958 }
3959 3959
3960 3960
3961 } // namespace blink 3961 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Touch.idl ('k') | Source/platform/PlatformTouchPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698