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

Unified Diff: third_party/WebKit/Source/core/frame/RemoteFrameView.cpp

Issue 2832883003: Remove unneeded Convert* methods and move many from FrameViewBase to FrameView (Closed)
Patch Set: fix ScrollableArea::ConvertFromScrollbarToContainingFrameViewBase and remove dchecks Created 3 years, 8 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: third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
index dd784310388351f4ce3f7d68e0bb315fdfc4b21f..daadfd1becc9a7e5bf49e6956e4d4a8d3217fcaa 100644
--- a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
@@ -104,9 +104,9 @@ void RemoteFrameView::FrameRectsChanged() {
// containing local frame root. The position of the local root within
// any remote frames, if any, is accounted for by the embedder.
IntRect new_rect = FrameRect();
- if (Parent() && Parent()->IsFrameView())
- new_rect = Parent()->ConvertToRootFrame(
- ToFrameView(Parent())->ContentsToFrame(new_rect));
+ if (const FrameView* parent = ToFrameView(Parent()))
+ new_rect = parent->ConvertToRootFrame(parent->ContentsToFrame(new_rect));
+
remote_frame_->Client()->FrameRectsChanged(new_rect);
UpdateRemoteViewportIntersection();
@@ -135,6 +135,18 @@ void RemoteFrameView::SetParentVisible(bool visible) {
remote_frame_->Client()->VisibilityChanged(IsVisible());
}
+IntRect RemoteFrameView::ConvertFromContainingFrameViewBase(
+ const IntRect& parent_rect) const {
+ if (const FrameView* parent = ToFrameView(Parent())) {
+ IntRect local_rect = parent_rect;
+ local_rect.SetLocation(
+ parent->ConvertSelfToChild(this, local_rect.Location()));
+ return local_rect;
+ }
+
+ return parent_rect;
+}
+
DEFINE_TRACE(RemoteFrameView) {
visitor->Trace(remote_frame_);
FrameViewBase::Trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698