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

Side by Side 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: remove scrollbar convert methods 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/RemoteFrameView.h" 5 #include "core/frame/RemoteFrameView.h"
6 6
7 #include "core/dom/IntersectionObserverEntry.h" 7 #include "core/dom/IntersectionObserverEntry.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/frame/RemoteFrame.h" 10 #include "core/frame/RemoteFrame.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 FrameViewBase::SetFrameRect(new_rect); 97 FrameViewBase::SetFrameRect(new_rect);
98 98
99 FrameRectsChanged(); 99 FrameRectsChanged();
100 } 100 }
101 101
102 void RemoteFrameView::FrameRectsChanged() { 102 void RemoteFrameView::FrameRectsChanged() {
103 // Update the rect to reflect the position of the frame relative to the 103 // Update the rect to reflect the position of the frame relative to the
104 // containing local frame root. The position of the local root within 104 // containing local frame root. The position of the local root within
105 // any remote frames, if any, is accounted for by the embedder. 105 // any remote frames, if any, is accounted for by the embedder.
106 IntRect new_rect = FrameRect(); 106 IntRect new_rect = FrameRect();
107 if (Parent() && Parent()->IsFrameView()) 107 if (Parent() && Parent()->IsFrameView()) {
108 new_rect = Parent()->ConvertToRootFrame( 108 FrameView* parent_frame_view = ToFrameView(Parent());
109 ToFrameView(Parent())->ContentsToFrame(new_rect)); 109 new_rect = parent_frame_view->ConvertToRootFrame(
110 parent_frame_view->ContentsToFrame(new_rect));
111 }
110 remote_frame_->Client()->FrameRectsChanged(new_rect); 112 remote_frame_->Client()->FrameRectsChanged(new_rect);
111 113
112 UpdateRemoteViewportIntersection(); 114 UpdateRemoteViewportIntersection();
113 } 115 }
114 116
115 void RemoteFrameView::Hide() { 117 void RemoteFrameView::Hide() {
116 SetSelfVisible(false); 118 SetSelfVisible(false);
117 119
118 remote_frame_->Client()->VisibilityChanged(false); 120 remote_frame_->Client()->VisibilityChanged(false);
119 } 121 }
120 122
121 void RemoteFrameView::Show() { 123 void RemoteFrameView::Show() {
122 SetSelfVisible(true); 124 SetSelfVisible(true);
123 125
124 remote_frame_->Client()->VisibilityChanged(true); 126 remote_frame_->Client()->VisibilityChanged(true);
125 } 127 }
126 128
127 void RemoteFrameView::SetParentVisible(bool visible) { 129 void RemoteFrameView::SetParentVisible(bool visible) {
128 if (IsParentVisible() == visible) 130 if (IsParentVisible() == visible)
129 return; 131 return;
130 132
131 FrameViewBase::SetParentVisible(visible); 133 FrameViewBase::SetParentVisible(visible);
132 if (!IsSelfVisible()) 134 if (!IsSelfVisible())
133 return; 135 return;
134 136
135 remote_frame_->Client()->VisibilityChanged(IsVisible()); 137 remote_frame_->Client()->VisibilityChanged(IsVisible());
136 } 138 }
137 139
140 IntRect RemoteFrameView::ConvertFromContainingFrameViewBase(
141 const IntRect& parent_rect) const {
142 if (const FrameView* parent = ToFrameView(Parent())) {
143 IntRect local_rect = parent_rect;
144 local_rect.SetLocation(
145 parent->ConvertSelfToChild(this, local_rect.Location()));
146 return local_rect;
147 }
148
149 return parent_rect;
150 }
151
138 DEFINE_TRACE(RemoteFrameView) { 152 DEFINE_TRACE(RemoteFrameView) {
139 visitor->Trace(remote_frame_); 153 visitor->Trace(remote_frame_);
140 FrameViewBase::Trace(visitor); 154 FrameViewBase::Trace(visitor);
141 } 155 }
142 156
143 } // namespace blink 157 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698