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

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: Created 5 years, 10 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
Index: Source/web/WebPluginContainerImpl.cpp
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
index 9953996b7500244c70633673b589c90e41af37fe..796c51953871406ccb352b38ecb901dafcfb842b 100644
--- a/Source/web/WebPluginContainerImpl.cpp
+++ b/Source/web/WebPluginContainerImpl.cpp
@@ -118,14 +118,14 @@ void WebPluginContainerImpl::paint(GraphicsContext* gc, const IntRect& damageRec
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));
gc->translate(static_cast<float>(-origin.x()), static_cast<float>(-origin.y()));
WebCanvas* canvas = gc->canvas();
- IntRect windowRect = view->contentsToWindow(damageRect);
+ IntRect windowRect = view->contentsToRootFrame(damageRect);
m_webPlugin->paint(canvas, windowRect);
gc->restore();
@@ -546,22 +546,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->renderer()->absoluteToLocal(FloatPoint(windowPoint), UseTransforms));
+ return pointInRootFrame;
+ WebPoint pointInContent = view->rootFrameToContents(pointInRootFrame);
+ return roundedIntPoint(m_element->renderer()->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->renderer()->localToAbsolute(FloatPoint(point), UseTransforms));
- return view->contentsToWindow(absolutePoint);
+ return pointInLocal;
+ IntPoint absolutePoint = roundedIntPoint(m_element->renderer()->localToAbsolute(FloatPoint(pointInLocal), UseTransforms));
+ return view->contentsToRootFrame(absolutePoint);
}
void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response)
@@ -965,7 +965,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();

Powered by Google App Engine
This is Rietveld 408576698