| 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 504 |
| 505 // FIXME: Change |widget| to const Widget& after RemoteFrames get | 505 // FIXME: Change |widget| to const Widget& after RemoteFrames get |
| 506 // RemoteFrameViews. | 506 // RemoteFrameViews. |
| 507 static void updateWebMouseEventFromCoreMouseEvent(const MouseRelatedEvent& event
, const Widget* widget, const LayoutItem layoutItem, WebMouseEvent& webEvent) | 507 static void updateWebMouseEventFromCoreMouseEvent(const MouseRelatedEvent& event
, const Widget* widget, const LayoutItem layoutItem, WebMouseEvent& webEvent) |
| 508 { | 508 { |
| 509 webEvent.timeStampSeconds = event.platformTimeStamp(); | 509 webEvent.timeStampSeconds = event.platformTimeStamp(); |
| 510 webEvent.modifiers = event.modifiers(); | 510 webEvent.modifiers = event.modifiers(); |
| 511 | 511 |
| 512 FrameView* view = widget ? toFrameView(widget->parent()) : 0; | 512 FrameView* view = widget ? toFrameView(widget->parent()) : 0; |
| 513 // TODO(bokan): If view == nullptr, pointInRootFrame will really be pointInR
ootContent. | 513 // TODO(bokan): If view == nullptr, pointInRootFrame will really be pointInR
ootContent. |
| 514 IntPoint pointInRootFrame = IntPoint(event.absoluteLocation().x(), event.abs
oluteLocation().y()); | 514 IntPoint pointInRootFrame = IntPoint(event.absoluteLocation().x().toInt(), e
vent.absoluteLocation().y().toInt()); |
| 515 if (view) | 515 if (view) |
| 516 pointInRootFrame = view->contentsToRootFrame(pointInRootFrame); | 516 pointInRootFrame = view->contentsToRootFrame(pointInRootFrame); |
| 517 webEvent.globalX = event.screenX(); | 517 webEvent.globalX = event.screenX(); |
| 518 webEvent.globalY = event.screenY(); | 518 webEvent.globalY = event.screenY(); |
| 519 webEvent.windowX = pointInRootFrame.x(); | 519 webEvent.windowX = pointInRootFrame.x(); |
| 520 webEvent.windowY = pointInRootFrame.y(); | 520 webEvent.windowY = pointInRootFrame.y(); |
| 521 IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteL
ocation(), layoutItem); | 521 IntPoint localPoint = convertAbsoluteLocationForLayoutObject(event.absoluteL
ocation(), layoutItem); |
| 522 webEvent.x = localPoint.x(); | 522 webEvent.x = localPoint.x(); |
| 523 webEvent.y = localPoint.y(); | 523 webEvent.y = localPoint.y(); |
| 524 } | 524 } |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 break; | 819 break; |
| 820 case GestureSourceTouchscreen: | 820 case GestureSourceTouchscreen: |
| 821 sourceDevice = WebGestureDeviceTouchscreen; | 821 sourceDevice = WebGestureDeviceTouchscreen; |
| 822 break; | 822 break; |
| 823 case GestureSourceUninitialized: | 823 case GestureSourceUninitialized: |
| 824 NOTREACHED(); | 824 NOTREACHED(); |
| 825 } | 825 } |
| 826 } | 826 } |
| 827 | 827 |
| 828 } // namespace blink | 828 } // namespace blink |
| OLD | NEW |