Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 247 m_type = PlatformEvent::GesturePinchUpdate; | 247 m_type = PlatformEvent::GesturePinchUpdate; |
| 248 m_data.m_pinchUpdate.m_scale = e.data.pinchUpdate.scale; | 248 m_data.m_pinchUpdate.m_scale = e.data.pinchUpdate.scale; |
| 249 break; | 249 break; |
| 250 default: | 250 default: |
| 251 ASSERT_NOT_REACHED(); | 251 ASSERT_NOT_REACHED(); |
| 252 } | 252 } |
| 253 m_position = widget->convertFromContainingWindow(flooredIntPoint(convertHitP ointToWindow(widget, FloatPoint(e.x, e.y)))); | 253 m_position = widget->convertFromContainingWindow(flooredIntPoint(convertHitP ointToWindow(widget, FloatPoint(e.x, e.y)))); |
| 254 m_globalPosition = IntPoint(e.globalX, e.globalY); | 254 m_globalPosition = IntPoint(e.globalX, e.globalY); |
| 255 m_timestamp = e.timeStampSeconds; | 255 m_timestamp = e.timeStampSeconds; |
| 256 m_modifiers = e.modifiers; | 256 m_modifiers = e.modifiers; |
| 257 switch (e.sourceDevice) { | |
| 258 case WebGestureDeviceUninitialized: | |
|
tdresser
2015/10/19 12:52:39
Let's put the exceptional case at the end.
wjmaclean
2015/10/19 15:26:55
Done.
| |
| 259 ASSERT_NOT_REACHED(); | |
| 260 break; | |
| 261 case WebGestureDeviceTouchpad: | |
| 262 m_source = PlatformGestureSourceTouchpad; | |
| 263 break; | |
| 264 case WebGestureDeviceTouchscreen: | |
| 265 m_source = PlatformGestureSourceTouchscreen; | |
| 266 } | |
| 257 } | 267 } |
| 258 | 268 |
| 259 // MakePlatformKeyboardEvent -------------------------------------------------- | 269 // MakePlatformKeyboardEvent -------------------------------------------------- |
| 260 | 270 |
| 261 inline PlatformEvent::Type toPlatformKeyboardEventType(WebInputEvent::Type type) | 271 inline PlatformEvent::Type toPlatformKeyboardEventType(WebInputEvent::Type type) |
| 262 { | 272 { |
| 263 switch (type) { | 273 switch (type) { |
| 264 case WebInputEvent::KeyUp: | 274 case WebInputEvent::KeyUp: |
| 265 return PlatformEvent::KeyUp; | 275 return PlatformEvent::KeyUp; |
| 266 case WebInputEvent::KeyDown: | 276 case WebInputEvent::KeyDown: |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 697 } | 707 } |
| 698 | 708 |
| 699 timeStampSeconds = convertDOMTimeStampToSeconds(event.createTime()); | 709 timeStampSeconds = convertDOMTimeStampToSeconds(event.createTime()); |
| 700 modifiers = event.modifiers(); | 710 modifiers = event.modifiers(); |
| 701 | 711 |
| 702 globalX = event.screenX(); | 712 globalX = event.screenX(); |
| 703 globalY = event.screenY(); | 713 globalY = event.screenY(); |
| 704 IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteL ocation(), *layoutObject); | 714 IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteL ocation(), *layoutObject); |
| 705 x = localPoint.x(); | 715 x = localPoint.x(); |
| 706 y = localPoint.y(); | 716 y = localPoint.y(); |
| 717 | |
| 718 switch (event.source()) { | |
| 719 case GestureSourceUninitialized: | |
|
tdresser
2015/10/19 12:52:39
ditto
wjmaclean
2015/10/19 15:26:55
Done.
| |
| 720 ASSERT_NOT_REACHED(); | |
| 721 break; | |
| 722 case GestureSourceTouchpad: | |
| 723 sourceDevice = WebGestureDeviceTouchpad; | |
| 724 break; | |
| 725 case GestureSourceTouchscreen: | |
| 726 sourceDevice = WebGestureDeviceTouchscreen; | |
| 727 } | |
| 707 } | 728 } |
| 708 | 729 |
| 709 } // namespace blink | 730 } // namespace blink |
| OLD | NEW |