OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // MSVC++ requires this to be set before any other includes to get M_PI. | 5 // MSVC++ requires this to be set before any other includes to get M_PI. |
6 #define _USE_MATH_DEFINES | 6 #define _USE_MATH_DEFINES |
7 | 7 |
8 #include "content/browser/renderer_host/input/motion_event_web.h" | 8 #include "content/browser/renderer_host/input/motion_event_web.h" |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 > event_.touches[pointer_index].radiusY) { | 137 > event_.touches[pointer_index].radiusY) { |
138 // The case radiusX == radiusY is omitted from here on purpose: for circles, | 138 // The case radiusX == radiusY is omitted from here on purpose: for circles, |
139 // we want to pass the angle (which could be any value in such cases but | 139 // we want to pass the angle (which could be any value in such cases but |
140 // always seem to be set to zero) unchanged. | 140 // always seem to be set to zero) unchanged. |
141 rotation_angle_rad -= (float) M_PI_2; | 141 rotation_angle_rad -= (float) M_PI_2; |
142 } | 142 } |
143 | 143 |
144 return rotation_angle_rad; | 144 return rotation_angle_rad; |
145 } | 145 } |
146 | 146 |
| 147 float MotionEventWeb::GetTilt(size_t pointer_index) const { |
| 148 return std::numeric_limits<float>::quiet_NaN(); |
| 149 } |
| 150 |
| 151 float MotionEventWeb::GetTiltDirection(size_t pointer_index) const { |
| 152 return std::numeric_limits<float>::quiet_NaN(); |
| 153 } |
| 154 |
147 float MotionEventWeb::GetPressure(size_t pointer_index) const { | 155 float MotionEventWeb::GetPressure(size_t pointer_index) const { |
148 return 0.f; | 156 return 0.f; |
149 } | 157 } |
150 | 158 |
151 base::TimeTicks MotionEventWeb::GetEventTime() const { | 159 base::TimeTicks MotionEventWeb::GetEventTime() const { |
152 return base::TimeTicks() + | 160 return base::TimeTicks() + |
153 base::TimeDelta::FromMicroseconds(event_.timeStampSeconds * | 161 base::TimeDelta::FromMicroseconds(event_.timeStampSeconds * |
154 base::Time::kMicrosecondsPerSecond); | 162 base::Time::kMicrosecondsPerSecond); |
155 } | 163 } |
156 | 164 |
157 ui::MotionEvent::ToolType MotionEventWeb::GetToolType( | 165 ui::MotionEvent::ToolType MotionEventWeb::GetToolType( |
158 size_t pointer_index) const { | 166 size_t pointer_index) const { |
159 // TODO(jdduke): Plumb tool type from the platform event, crbug.com/404128. | 167 // TODO(jdduke): Plumb tool type from the platform event, crbug.com/404128. |
160 DCHECK_LT(pointer_index, GetPointerCount()); | 168 DCHECK_LT(pointer_index, GetPointerCount()); |
161 return TOOL_TYPE_UNKNOWN; | 169 return TOOL_TYPE_UNKNOWN; |
162 } | 170 } |
163 | 171 |
164 int MotionEventWeb::GetButtonState() const { | 172 int MotionEventWeb::GetButtonState() const { |
165 return 0; | 173 return 0; |
166 } | 174 } |
167 | 175 |
168 int MotionEventWeb::GetFlags() const { | 176 int MotionEventWeb::GetFlags() const { |
169 return WebEventModifiersToEventFlags(event_.modifiers); | 177 return WebEventModifiersToEventFlags(event_.modifiers); |
170 } | 178 } |
171 | 179 |
172 } // namespace content | 180 } // namespace content |
OLD | NEW |