diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:09:45 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:10:13 +0100 |
commit | 470286ecfe79d59df14944e5b5d34630fc739391 (patch) | |
tree | 43983212872e06cebefd2ae474418fa2908ca54c /Source/WebKit/chromium/src/WebPluginContainerImpl.cpp | |
parent | 23037105e948c2065da5a937d3a2396b0ff45c1e (diff) | |
download | qtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz |
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebKit/chromium/src/WebPluginContainerImpl.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/WebPluginContainerImpl.cpp | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index 87a660156..075fc0548 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -67,6 +67,7 @@ #include "ScrollAnimator.h" #include "ScrollView.h" #include "ScrollbarTheme.h" +#include "ScrollingCoordinator.h" #include "TouchEvent.h" #include "UserGestureIndicator.h" #include "WebPrintParams.h" @@ -133,13 +134,12 @@ void WebPluginContainerImpl::paint(GraphicsContext* gc, const IntRect& damageRec // The plugin is positioned in window coordinates, so it needs to be painted // in window coordinates. - IntPoint origin = view->windowToContents(IntPoint(0, 0)); - gc->translate(static_cast<float>(origin.x()), static_cast<float>(origin.y())); + IntPoint origin = view->contentsToWindow(IntPoint(0, 0)); + gc->translate(static_cast<float>(-origin.x()), static_cast<float>(-origin.y())); WebCanvas* canvas = gc->platformContext()->canvas(); - IntRect windowRect = - IntRect(view->contentsToWindow(enclosingIntRect(scaledDamageRect).location()), enclosingIntRect(scaledDamageRect).size()); + IntRect windowRect = view->contentsToWindow(enclosingIntRect(scaledDamageRect)); m_webPlugin->paint(canvas, windowRect); gc->restore(); @@ -532,6 +532,28 @@ void WebPluginContainerImpl::setIsAcceptingTouchEvents(bool acceptingTouchEvents m_element->document()->didRemoveTouchEventHandler(); } +void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents) +{ + if (m_wantsWheelEvents == wantsWheelEvents) + return; + m_wantsWheelEvents = wantsWheelEvents; + if (Page* page = m_element->document()->page()) { + if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) { + if (parent() && parent()->isFrameView()) + scrollingCoordinator->frameViewLayoutUpdated(static_cast<FrameView*>(parent())); + } + } +} + +WebPoint WebPluginContainerImpl::windowToLocalPoint(const WebPoint& point) +{ + ScrollView* view = parent(); + if (!view) + return point; + WebPoint windowPoint = view->windowToContents(point); + return roundedIntPoint(m_element->renderer()->absoluteToLocal(LayoutPoint(windowPoint), UseTransforms | SnapOffsetForTransforms)); +} + void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response) { // Make sure that the plugin receives window geometry before data, or else @@ -582,6 +604,11 @@ bool WebPluginContainerImpl::canProcessDrag() const return m_webPlugin->canProcessDrag(); } +bool WebPluginContainerImpl::wantsWheelEvents() +{ + return m_wantsWheelEvents; +} + void WebPluginContainerImpl::willDestroyPluginLoadObserver(WebPluginLoadObserver* observer) { size_t pos = m_pluginLoadObservers.find(observer); @@ -641,6 +668,7 @@ WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* eleme , m_ioSurfaceId(0) #endif , m_isAcceptingTouchEvents(false) + , m_wantsWheelEvents(false) { } @@ -818,8 +846,7 @@ void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect, IntRect& clipRect, Vector<IntRect>& cutOutRects) { - windowRect = IntRect( - parent()->contentsToWindow(frameRect.location()), frameRect.size()); + windowRect = parent()->contentsToWindow(frameRect); // Calculate a clip-rect so that we don't overlap the scrollbars, etc. clipRect = windowClipRect(); |