Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 2586133003: Remove PlatformWheelEvent and use WebMouseWheelEvent instead (Closed)
Patch Set: Address comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 static_cast<WebDragOperationsMask>(dataTransfer->sourceOperation()); 751 static_cast<WebDragOperationsMask>(dataTransfer->sourceOperation());
752 WebPoint dragScreenLocation(event->screenX(), event->screenY()); 752 WebPoint dragScreenLocation(event->screenX(), event->screenY());
753 WebPoint dragLocation(event->absoluteLocation().x() - location().x(), 753 WebPoint dragLocation(event->absoluteLocation().x() - location().x(),
754 event->absoluteLocation().y() - location().y()); 754 event->absoluteLocation().y() - location().y());
755 755
756 m_webPlugin->handleDragStatusUpdate(dragStatus, dragData, dragOperationMask, 756 m_webPlugin->handleDragStatusUpdate(dragStatus, dragData, dragOperationMask,
757 dragLocation, dragScreenLocation); 757 dragLocation, dragScreenLocation);
758 } 758 }
759 759
760 void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event) { 760 void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event) {
761 WebMouseWheelEventBuilder webEvent( 761 WebFloatPoint absoluteRootFrameLocation =
762 this, LayoutItem(m_element->layoutObject()), *event); 762 event->nativeEvent().positionInRootFrame();
763 if (webEvent.type == WebInputEvent::Undefined) 763 IntPoint localPoint =
764 return; 764 roundedIntPoint(m_element->layoutObject()->absoluteToLocal(
765 absoluteRootFrameLocation, UseTransforms));
766 WebMouseWheelEvent translatedEvent = event->nativeEvent().flattenTransform();
767 translatedEvent.x = localPoint.x();
768 translatedEvent.y = localPoint.y();
765 769
766 WebCursorInfo cursorInfo; 770 WebCursorInfo cursorInfo;
767 if (m_webPlugin->handleInputEvent(webEvent, cursorInfo) != 771 if (m_webPlugin->handleInputEvent(translatedEvent, cursorInfo) !=
768 WebInputEventResult::NotHandled) 772 WebInputEventResult::NotHandled)
769 event->setDefaultHandled(); 773 event->setDefaultHandled();
770 } 774 }
771 775
772 void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event) { 776 void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event) {
773 WebKeyboardEventBuilder webEvent(*event); 777 WebKeyboardEventBuilder webEvent(*event);
774 if (webEvent.type == WebInputEvent::Undefined) 778 if (webEvent.type == WebInputEvent::Undefined)
775 return; 779 return;
776 780
777 if (webEvent.type == WebInputEvent::KeyDown) { 781 if (webEvent.type == WebInputEvent::KeyDown) {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 // frame view. 973 // frame view.
970 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect); 974 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRect);
971 } 975 }
972 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 976 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
973 // Convert to the plugin position. 977 // Convert to the plugin position.
974 for (size_t i = 0; i < cutOutRects.size(); i++) 978 for (size_t i = 0; i < cutOutRects.size(); i++)
975 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 979 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
976 } 980 }
977 981
978 } // namespace blink 982 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698