OLD | NEW |
---|---|
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 "content/browser/frame_host/cross_process_frame_connector.h" | 5 #include "content/browser/frame_host/cross_process_frame_connector.h" |
6 | 6 |
7 #include "cc/surfaces/surface.h" | 7 #include "cc/surfaces/surface.h" |
8 #include "cc/surfaces/surface_manager.h" | 8 #include "cc/surfaces/surface_manager.h" |
9 #include "content/browser/compositor/surface_utils.h" | 9 #include "content/browser/compositor/surface_utils.h" |
10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 void CrossProcessFrameConnector::OnFrameRectChanged( | 226 void CrossProcessFrameConnector::OnFrameRectChanged( |
227 const gfx::Rect& frame_rect) { | 227 const gfx::Rect& frame_rect) { |
228 if (!frame_rect.size().IsEmpty()) | 228 if (!frame_rect.size().IsEmpty()) |
229 SetSize(frame_rect); | 229 SetSize(frame_rect); |
230 } | 230 } |
231 | 231 |
232 void CrossProcessFrameConnector::OnVisibilityChanged(bool visible) { | 232 void CrossProcessFrameConnector::OnVisibilityChanged(bool visible) { |
233 if (!view_) | 233 if (!view_) |
234 return; | 234 return; |
235 | 235 |
236 // For <webview>, the WebContents should be notified of the change. The | |
lazyboy
2016/01/16 00:46:48
Avoid using "<webview>". Use "inner WebContents" i
EhsanK
2016/01/20 00:00:03
Done.
| |
237 // WebContents will inform the RWH itself. | |
238 if (frame_proxy_in_parent_renderer_->frame_tree_node() | |
239 ->render_manager() | |
240 ->ForInnerDelegate()) { | |
241 RenderWidgetHostImpl::From(view_->GetRenderWidgetHost()) | |
242 ->delegate() | |
243 ->ForwardVisibilityChange(visible); | |
244 return; | |
245 } | |
246 | |
236 if (visible) | 247 if (visible) |
237 view_->Show(); | 248 view_->Show(); |
238 else | 249 else |
239 view_->Hide(); | 250 view_->Hide(); |
240 } | 251 } |
241 | 252 |
242 void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) { | 253 void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) { |
243 device_scale_factor_ = scale_factor; | 254 device_scale_factor_ = scale_factor; |
244 // The RenderWidgetHost is null in unit tests. | 255 // The RenderWidgetHost is null in unit tests. |
245 if (view_ && view_->GetRenderWidgetHost()) { | 256 if (view_ && view_->GetRenderWidgetHost()) { |
(...skipping 18 matching lines...) Expand all Loading... | |
264 // in the case of nested WebContents. | 275 // in the case of nested WebContents. |
265 while (top_host->frame_tree_node()->render_manager()->ForInnerDelegate()) { | 276 while (top_host->frame_tree_node()->render_manager()->ForInnerDelegate()) { |
266 top_host = top_host->frame_tree_node()->render_manager()-> | 277 top_host = top_host->frame_tree_node()->render_manager()-> |
267 GetOuterDelegateNode()->frame_tree()->root()->current_frame_host(); | 278 GetOuterDelegateNode()->frame_tree()->root()->current_frame_host(); |
268 } | 279 } |
269 | 280 |
270 return static_cast<RenderWidgetHostViewBase*>(top_host->GetView()); | 281 return static_cast<RenderWidgetHostViewBase*>(top_host->GetView()); |
271 } | 282 } |
272 | 283 |
273 } // namespace content | 284 } // namespace content |
OLD | NEW |