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

Unified Diff: Source/web/WebPluginContainerImpl.cpp

Issue 967213004: Removed FrameView's windowToContents and contentsToWindow methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebPluginContainerImpl.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebPluginContainerImpl.cpp
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
index 3d12255c46051d5b99661ba19c65025c1834a1fa..14d27e068f4994274304e987336c351fd898f4cd 100644
--- a/Source/web/WebPluginContainerImpl.cpp
+++ b/Source/web/WebPluginContainerImpl.cpp
@@ -123,14 +123,14 @@ void WebPluginContainerImpl::paint(GraphicsContext* context, const IntRect& rect
ASSERT(parent()->isFrameView());
FrameView* view = toFrameView(parent());
- // The plugin is positioned in window coordinates, so it needs to be painted
- // in window coordinates.
- IntPoint origin = view->contentsToWindow(IntPoint(0, 0));
+ // The plugin is positioned in the root frame's coordinates, so it needs to
+ // be painted in them too.
+ IntPoint origin = view->contentsToRootFrame(IntPoint(0, 0));
context->translate(static_cast<float>(-origin.x()), static_cast<float>(-origin.y()));
WebCanvas* canvas = context->canvas();
- IntRect windowRect = view->contentsToWindow(rect);
+ IntRect windowRect = view->contentsToRootFrame(rect);
m_webPlugin->paint(canvas, windowRect);
context->restore();
@@ -551,22 +551,22 @@ void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents)
}
}
-WebPoint WebPluginContainerImpl::windowToLocalPoint(const WebPoint& point)
+WebPoint WebPluginContainerImpl::rootFrameToLocalPoint(const WebPoint& pointInRootFrame)
{
FrameView* view = toFrameView(parent());
if (!view)
- return point;
- WebPoint windowPoint = view->windowToContents(point);
- return roundedIntPoint(m_element->layoutObject()->absoluteToLocal(FloatPoint(windowPoint), UseTransforms));
+ return pointInRootFrame;
+ WebPoint pointInContent = view->rootFrameToContents(pointInRootFrame);
+ return roundedIntPoint(m_element->layoutObject()->absoluteToLocal(FloatPoint(pointInContent), UseTransforms));
}
-WebPoint WebPluginContainerImpl::localToWindowPoint(const WebPoint& point)
+WebPoint WebPluginContainerImpl::localToRootFramePoint(const WebPoint& pointInLocal)
{
FrameView* view = toFrameView(parent());
if (!view)
- return point;
- IntPoint absolutePoint = roundedIntPoint(m_element->layoutObject()->localToAbsolute(FloatPoint(point), UseTransforms));
- return view->contentsToWindow(absolutePoint);
+ return pointInLocal;
+ IntPoint absolutePoint = roundedIntPoint(m_element->layoutObject()->localToAbsolute(FloatPoint(pointInLocal), UseTransforms));
+ return view->contentsToRootFrame(absolutePoint);
}
void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response)
@@ -970,7 +970,7 @@ void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect,
IntRect& clipRect,
Vector<IntRect>& cutOutRects)
{
- windowRect = toFrameView(parent())->contentsToWindow(frameRect);
+ windowRect = toFrameView(parent())->contentsToRootFrame(frameRect);
// Calculate a clip-rect so that we don't overlap the scrollbars, etc.
clipRect = windowClipRect();
« no previous file with comments | « Source/web/WebPluginContainerImpl.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698