OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/web_input_event_util.h" | 8 #include "content/browser/renderer_host/input/web_input_event_util.h" |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 base::snprintf(event->keyIdentifier, | 251 base::snprintf(event->keyIdentifier, |
252 sizeof(event->keyIdentifier), | 252 sizeof(event->keyIdentifier), |
253 "U+%04X", | 253 "U+%04X", |
254 base::ToUpperASCII(static_cast<int>(windows_key_code))); | 254 base::ToUpperASCII(static_cast<int>(windows_key_code))); |
255 } | 255 } |
256 } | 256 } |
257 | 257 |
258 blink::WebTouchEvent CreateWebTouchEventFromMotionEvent( | 258 blink::WebTouchEvent CreateWebTouchEventFromMotionEvent( |
259 const ui::MotionEvent& event, | 259 const ui::MotionEvent& event, |
260 bool may_cause_scrolling) { | 260 bool may_cause_scrolling) { |
261 COMPILE_ASSERT(static_cast<int>(MotionEvent::MAX_TOUCH_POINT_COUNT) == | 261 static_assert(static_cast<int>(MotionEvent::MAX_TOUCH_POINT_COUNT) == |
262 static_cast<int>(blink::WebTouchEvent::touchesLengthCap), | 262 static_cast<int>(blink::WebTouchEvent::touchesLengthCap), |
263 inconsistent_maximum_number_of_active_touch_points); | 263 "inconsistent maximum number of active touch points"); |
264 | 264 |
265 blink::WebTouchEvent result; | 265 blink::WebTouchEvent result; |
266 | 266 |
267 WebTouchEventTraits::ResetType( | 267 WebTouchEventTraits::ResetType( |
268 ToWebInputEventType(event.GetAction()), | 268 ToWebInputEventType(event.GetAction()), |
269 (event.GetEventTime() - base::TimeTicks()).InSecondsF(), | 269 (event.GetEventTime() - base::TimeTicks()).InSecondsF(), |
270 &result); | 270 &result); |
271 result.causesScrollingIfUncanceled = may_cause_scrolling; | 271 result.causesScrollingIfUncanceled = may_cause_scrolling; |
272 | 272 |
273 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags()); | 273 result.modifiers = EventFlagsToWebEventModifiers(event.GetFlags()); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 flags |= ui::EF_CAPS_LOCK_DOWN; | 453 flags |= ui::EF_CAPS_LOCK_DOWN; |
454 if (modifiers & blink::WebInputEvent::IsAutoRepeat) | 454 if (modifiers & blink::WebInputEvent::IsAutoRepeat) |
455 flags |= ui::EF_IS_REPEAT; | 455 flags |= ui::EF_IS_REPEAT; |
456 if (modifiers & blink::WebInputEvent::IsKeyPad) | 456 if (modifiers & blink::WebInputEvent::IsKeyPad) |
457 flags |= ui::EF_NUMPAD_KEY; | 457 flags |= ui::EF_NUMPAD_KEY; |
458 | 458 |
459 return flags; | 459 return flags; |
460 } | 460 } |
461 | 461 |
462 } // namespace content | 462 } // namespace content |
OLD | NEW |