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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 static IntPoint convertAbsoluteLocationForLayoutObjectInt( | 342 static IntPoint convertAbsoluteLocationForLayoutObjectInt( |
343 const DoublePoint& location, | 343 const DoublePoint& location, |
344 const LayoutItem layoutItem) { | 344 const LayoutItem layoutItem) { |
345 return roundedIntPoint( | 345 return roundedIntPoint( |
346 convertAbsoluteLocationForLayoutObjectFloat(location, layoutItem)); | 346 convertAbsoluteLocationForLayoutObjectFloat(location, layoutItem)); |
347 } | 347 } |
348 | 348 |
349 // FIXME: Change |widget| to const Widget& after RemoteFrames get | 349 // FIXME: Change |widget| to const Widget& after RemoteFrames get |
350 // RemoteFrameViews. | 350 // RemoteFrameViews. |
351 static void updateWebMouseEventFromCoreMouseEvent( | 351 static void updateWebMouseEventFromCoreMouseEvent(const MouseEvent& event, |
352 const MouseRelatedEvent& event, | 352 const Widget* widget, |
353 const Widget* widget, | 353 const LayoutItem layoutItem, |
354 const LayoutItem layoutItem, | 354 WebMouseEvent& webEvent) { |
355 WebMouseEvent& webEvent) { | |
356 webEvent.timeStampSeconds = event.platformTimeStamp().InSeconds(); | 355 webEvent.timeStampSeconds = event.platformTimeStamp().InSeconds(); |
357 webEvent.modifiers = event.modifiers(); | 356 webEvent.modifiers = event.modifiers(); |
358 | 357 |
359 FrameView* view = widget ? toFrameView(widget->parent()) : 0; | 358 FrameView* view = widget ? toFrameView(widget->parent()) : 0; |
360 // TODO(bokan): If view == nullptr, pointInRootFrame will really be | 359 // TODO(bokan): If view == nullptr, pointInRootFrame will really be |
361 // pointInRootContent. | 360 // pointInRootContent. |
362 IntPoint pointInRootFrame(event.absoluteLocation().x(), | 361 IntPoint pointInRootFrame(event.absoluteLocation().x(), |
363 event.absoluteLocation().y()); | 362 event.absoluteLocation().y()); |
364 if (view) | 363 if (view) |
365 pointInRootFrame = view->contentsToRootFrame(pointInRootFrame); | 364 pointInRootFrame = view->contentsToRootFrame(pointInRootFrame); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 Vector<PlatformTouchEvent> result; | 645 Vector<PlatformTouchEvent> result; |
647 for (const auto& event : coalescedEvents) { | 646 for (const auto& event : coalescedEvents) { |
648 DCHECK(WebInputEvent::isTouchEventType(event->type)); | 647 DCHECK(WebInputEvent::isTouchEventType(event->type)); |
649 result.append(PlatformTouchEventBuilder( | 648 result.append(PlatformTouchEventBuilder( |
650 widget, static_cast<const WebTouchEvent&>(*event))); | 649 widget, static_cast<const WebTouchEvent&>(*event))); |
651 } | 650 } |
652 return result; | 651 return result; |
653 } | 652 } |
654 | 653 |
655 } // namespace blink | 654 } // namespace blink |
OLD | NEW |