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

Unified Diff: Source/core/frame/FrameView.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/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 205b4f3b9877d7573ccc2f6783083c628df5f03a..846bbf5907dbcb235d808b1f94919a8bddc6f2db 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -1755,7 +1755,7 @@ void FrameView::contentRectangleForPaintInvalidation(const IntRect& rectInConten
return;
if (HostWindow* window = hostWindow())
- window->invalidateRect(contentsToWindow(paintRect));
+ window->invalidateRect(contentsToRootFrame(paintRect));
}
void FrameView::contentsResized()
@@ -2179,7 +2179,7 @@ IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co
ASSERT(m_frame->view() == this);
// Set our clip rect to be our contents.
- IntRect clipRect = contentsToWindow(visibleContentRect(scrollbarInclusion));
+ IntRect clipRect = contentsToRootFrame(visibleContentRect(scrollbarInclusion));
if (!m_frame->deprecatedLocalOwner())
return clipRect;
@@ -2209,7 +2209,7 @@ IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne
DisableCompositingQueryAsserts disabler;
// Apply the clip from the layer.
- IntRect clipRect = contentsToWindow(pixelSnappedIntRect(enclosingLayer->clipper().childrenClipRect()));
+ IntRect clipRect = contentsToRootFrame(pixelSnappedIntRect(enclosingLayer->clipper().childrenClipRect()));
return intersection(clipRect, windowClipRect());
}
@@ -3654,34 +3654,38 @@ IntRect FrameView::contentsToRootFrame(const IntRect& contentsRect) const
return convertToContainingWindow(rectInFrame);
}
-IntPoint FrameView::windowToContents(const IntPoint& windowPoint) const
+FloatPoint FrameView::rootFrameToContents(const FloatPoint& windowPoint) const
{
- IntPoint framePoint = convertFromContainingWindow(windowPoint);
+ FloatPoint framePoint = convertFromContainingWindow(windowPoint);
return frameToContents(framePoint);
}
-FloatPoint FrameView::windowToContents(const FloatPoint& windowPoint) const
+IntRect FrameView::viewportToContents(const IntRect& rectInViewport) const
{
- FloatPoint framePoint = convertFromContainingWindow(windowPoint);
- return frameToContents(framePoint);
+ IntRect rectInRootFrame = page()->frameHost().pinchViewport().viewportToRootFrame(rectInViewport);
+ IntRect frameRect = convertFromContainingWindow(rectInRootFrame);
Rick Byers 2015/03/05 17:56:20 Are you planning on updating the terms in the Widg
bokan 2015/03/06 21:54:37 Yes, I plan to do that in another patch though as
+ return frameToContents(frameRect);
}
-IntPoint FrameView::contentsToWindow(const IntPoint& contentsPoint) const
+IntPoint FrameView::viewportToContents(const IntPoint& pointInViewport) const
{
- IntPoint framePoint = contentsToFrame(contentsPoint);
- return convertToContainingWindow(framePoint);
+ IntPoint pointInRootFrame = page()->frameHost().pinchViewport().viewportToRootFrame(pointInViewport);
+ IntPoint pointInFrame = convertFromContainingWindow(pointInRootFrame);
+ return frameToContents(pointInFrame);
}
-IntRect FrameView::windowToContents(const IntRect& windowRect) const
+IntRect FrameView::contentsToViewport(const IntRect& rectInContents) const
{
- IntRect rectInFrame = convertFromContainingWindow(windowRect);
- return frameToContents(rectInFrame);
+ IntRect rectInFrame = contentsToFrame(rectInContents);
+ IntRect rectInRootFrame = convertToContainingWindow(rectInFrame);
+ return page()->frameHost().pinchViewport().rootFrameToViewport(rectInRootFrame);
}
-IntRect FrameView::contentsToWindow(const IntRect& contentsRect) const
+IntPoint FrameView::contentsToViewport(const IntPoint& pointInContents) const
{
- IntRect rectInFrame = contentsToFrame(contentsRect);
- return convertToContainingWindow(rectInFrame);
+ IntPoint pointInFrame = contentsToFrame(pointInContents);
+ IntPoint pointInRootFrame = convertToContainingWindow(pointInFrame);
+ return page()->frameHost().pinchViewport().rootFrameToViewport(pointInRootFrame);
}
IntRect FrameView::contentsToScreen(const IntRect& rect) const
@@ -3689,7 +3693,14 @@ IntRect FrameView::contentsToScreen(const IntRect& rect) const
HostWindow* window = hostWindow();
if (!window)
return IntRect();
- return window->viewportToScreen(contentsToWindow(rect));
+ return window->viewportToScreen(contentsToViewport(rect));
+}
+
+IntRect FrameView::soonToBeRemovedContentsToUnscaledViewport(const IntRect& rectInContents) const
+{
+ IntRect rectInFrame = contentsToFrame(rectInContents);
+ IntRect rectInRootFrame = convertToContainingWindow(rectInFrame);
+ return enclosingIntRect(page()->frameHost().pinchViewport().mainViewToViewportCSSPixels(rectInRootFrame));
}
bool FrameView::containsScrollbarsAvoidingResizer() const
@@ -3846,7 +3857,7 @@ void FrameView::paintPanScrollIcon(GraphicsContext* context)
DEFINE_STATIC_REF(Image, panScrollIcon, (Image::loadPlatformResource("panIcon")));
IntPoint iconGCPoint = m_panScrollIconPoint;
if (parent())
- iconGCPoint = toFrameView(parent())->windowToContents(iconGCPoint);
+ iconGCPoint = toFrameView(parent())->rootFrameToContents(iconGCPoint);
context->drawImage(panScrollIcon, iconGCPoint);
}

Powered by Google App Engine
This is Rietveld 408576698