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

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: Make Touch.tilt available behind the enable-experimental-web-platform-features flag Created 5 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
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #include "platform/WindowsKeyboardCodes.h" 90 #include "platform/WindowsKeyboardCodes.h"
91 #include "platform/geometry/FloatPoint.h" 91 #include "platform/geometry/FloatPoint.h"
92 #include "platform/graphics/Image.h" 92 #include "platform/graphics/Image.h"
93 #include "platform/heap/Handle.h" 93 #include "platform/heap/Handle.h"
94 #include "platform/scroll/ScrollAnimator.h" 94 #include "platform/scroll/ScrollAnimator.h"
95 #include "platform/scroll/Scrollbar.h" 95 #include "platform/scroll/Scrollbar.h"
96 #include "wtf/Assertions.h" 96 #include "wtf/Assertions.h"
97 #include "wtf/CurrentTime.h" 97 #include "wtf/CurrentTime.h"
98 #include "wtf/StdLibExtras.h" 98 #include "wtf/StdLibExtras.h"
99 #include "wtf/TemporaryChange.h" 99 #include "wtf/TemporaryChange.h"
100
Rick Byers 2015/02/04 11:48:56 was this on purpose?
d.pikalov 2015/02/11 11:17:13 Done.
101 namespace blink { 100 namespace blink {
102 101
103 using namespace HTMLNames; 102 using namespace HTMLNames;
104 103
105 // The link drag hysteresis is much larger than the others because there 104 // The link drag hysteresis is much larger than the others because there
106 // needs to be enough space to cancel the link press without starting a link dra g, 105 // needs to be enough space to cancel the link press without starting a link dra g,
107 // and because dragging links is rare. 106 // and because dragging links is rare.
108 static const int LinkDragHysteresis = 40; 107 static const int LinkDragHysteresis = 40;
109 static const int ImageDragHysteresis = 5; 108 static const int ImageDragHysteresis = 5;
110 static const int TextDragHysteresis = 3; 109 static const int TextDragHysteresis = 3;
(...skipping 3619 matching lines...) Expand 10 before | Expand all | Expand 10 after
3730 // pagePoint should always be relative to the target elements 3729 // pagePoint should always be relative to the target elements
3731 // containing frame. 3730 // containing frame.
3732 FloatPoint pagePoint = targetFrame->view()->windowToContents(point.pos() ); 3731 FloatPoint pagePoint = targetFrame->view()->windowToContents(point.pos() );
3733 3732
3734 float scaleFactor = 1.0f / targetFrame->pageZoomFactor(); 3733 float scaleFactor = 1.0f / targetFrame->pageZoomFactor();
3735 3734
3736 FloatPoint adjustedPagePoint = pagePoint.scaledBy(scaleFactor); 3735 FloatPoint adjustedPagePoint = pagePoint.scaledBy(scaleFactor);
3737 FloatSize adjustedRadius = point.radius().scaledBy(scaleFactor); 3736 FloatSize adjustedRadius = point.radius().scaledBy(scaleFactor);
3738 3737
3739 RefPtrWillBeRawPtr<Touch> touch = Touch::create( 3738 RefPtrWillBeRawPtr<Touch> touch = Touch::create(
3740 targetFrame, touchTarget.get(), point.id(), point.screenPos(), adjus tedPagePoint, adjustedRadius, point.rotationAngle(), point.force()); 3739 targetFrame, touchTarget.get(), point.id(), point.screenPos(), adjus tedPagePoint, adjustedRadius, point.rotationAngle(), point.tilt(), point.force() );
3741 3740
3742 // Ensure this target's touch list exists, even if it ends up empty, so 3741 // Ensure this target's touch list exists, even if it ends up empty, so
3743 // it can always be passed to TouchEvent::Create below. 3742 // it can always be passed to TouchEvent::Create below.
3744 TargetTouchesHeapMap::iterator targetTouchesIterator = touchesByTarget.f ind(touchTarget.get()); 3743 TargetTouchesHeapMap::iterator targetTouchesIterator = touchesByTarget.f ind(touchTarget.get());
3745 if (targetTouchesIterator == touchesByTarget.end()) { 3744 if (targetTouchesIterator == touchesByTarget.end()) {
3746 touchesByTarget.set(touchTarget.get(), TouchList::create()); 3745 touchesByTarget.set(touchTarget.get(), TouchList::create());
3747 targetTouchesIterator = touchesByTarget.find(touchTarget.get()); 3746 targetTouchesIterator = touchesByTarget.find(touchTarget.get());
3748 } 3747 }
3749 3748
3750 // touches and targetTouches should only contain information about 3749 // touches and targetTouches should only contain information about
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
3906 unsigned EventHandler::accessKeyModifiers() 3905 unsigned EventHandler::accessKeyModifiers()
3907 { 3906 {
3908 #if OS(MACOSX) 3907 #if OS(MACOSX)
3909 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3908 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3910 #else 3909 #else
3911 return PlatformEvent::AltKey; 3910 return PlatformEvent::AltKey;
3912 #endif 3911 #endif
3913 } 3912 }
3914 3913
3915 } // namespace blink 3914 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698