OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ui/events/blink/blink_event_util.h" | 8 #include "ui/events/blink/blink_event_util.h" |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 if (flags & EF_LEFT_MOUSE_BUTTON) | 170 if (flags & EF_LEFT_MOUSE_BUTTON) |
171 modifiers |= blink::WebInputEvent::LeftButtonDown; | 171 modifiers |= blink::WebInputEvent::LeftButtonDown; |
172 if (flags & EF_MIDDLE_MOUSE_BUTTON) | 172 if (flags & EF_MIDDLE_MOUSE_BUTTON) |
173 modifiers |= blink::WebInputEvent::MiddleButtonDown; | 173 modifiers |= blink::WebInputEvent::MiddleButtonDown; |
174 if (flags & EF_RIGHT_MOUSE_BUTTON) | 174 if (flags & EF_RIGHT_MOUSE_BUTTON) |
175 modifiers |= blink::WebInputEvent::RightButtonDown; | 175 modifiers |= blink::WebInputEvent::RightButtonDown; |
176 if (flags & EF_CAPS_LOCK_DOWN) | 176 if (flags & EF_CAPS_LOCK_DOWN) |
177 modifiers |= blink::WebInputEvent::CapsLockOn; | 177 modifiers |= blink::WebInputEvent::CapsLockOn; |
178 if (flags & EF_IS_REPEAT) | 178 if (flags & EF_IS_REPEAT) |
179 modifiers |= blink::WebInputEvent::IsAutoRepeat; | 179 modifiers |= blink::WebInputEvent::IsAutoRepeat; |
180 if (flags & EF_NUMPAD_KEY) | |
181 modifiers |= blink::WebInputEvent::IsKeyPad; | |
kpschoedel
2015/05/01 16:13:17
There was a lurking bug here — see the (ex-) defin
| |
182 | 180 |
183 return modifiers; | 181 return modifiers; |
184 } | 182 } |
185 | 183 |
186 WebGestureEvent CreateWebGestureEvent(const GestureEventDetails& details, | 184 WebGestureEvent CreateWebGestureEvent(const GestureEventDetails& details, |
187 base::TimeDelta timestamp, | 185 base::TimeDelta timestamp, |
188 const gfx::PointF& location, | 186 const gfx::PointF& location, |
189 const gfx::PointF& raw_location, | 187 const gfx::PointF& raw_location, |
190 int flags) { | 188 int flags) { |
191 WebGestureEvent gesture; | 189 WebGestureEvent gesture; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
296 } | 294 } |
297 | 295 |
298 WebGestureEvent CreateWebGestureEventFromGestureEventData( | 296 WebGestureEvent CreateWebGestureEventFromGestureEventData( |
299 const GestureEventData& data) { | 297 const GestureEventData& data) { |
300 return CreateWebGestureEvent(data.details, data.time - base::TimeTicks(), | 298 return CreateWebGestureEvent(data.details, data.time - base::TimeTicks(), |
301 gfx::PointF(data.x, data.y), | 299 gfx::PointF(data.x, data.y), |
302 gfx::PointF(data.raw_x, data.raw_y), data.flags); | 300 gfx::PointF(data.raw_x, data.raw_y), data.flags); |
303 } | 301 } |
304 | 302 |
305 } // namespace ui | 303 } // namespace ui |
OLD | NEW |