OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 3774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3785 } | 3785 } |
3786 | 3786 |
3787 NavigationEntry* | 3787 NavigationEntry* |
3788 WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() { | 3788 WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() { |
3789 return controller_.GetLastCommittedEntry(); | 3789 return controller_.GetLastCommittedEntry(); |
3790 } | 3790 } |
3791 | 3791 |
3792 bool WebContentsImpl::CreateRenderViewForRenderManager( | 3792 bool WebContentsImpl::CreateRenderViewForRenderManager( |
3793 RenderViewHost* render_view_host, | 3793 RenderViewHost* render_view_host, |
3794 int opener_route_id, | 3794 int opener_route_id, |
3795 CrossProcessFrameConnector* frame_connector) { | 3795 bool for_subframe) { |
3796 TRACE_EVENT0("browser", "WebContentsImpl::CreateRenderViewForRenderManager"); | 3796 TRACE_EVENT0("browser", "WebContentsImpl::CreateRenderViewForRenderManager"); |
3797 // Can be NULL during tests. | 3797 // Can be NULL during tests. |
3798 RenderWidgetHostViewBase* rwh_view; | 3798 RenderWidgetHostViewBase* rwh_view; |
3799 // TODO(kenrb): RenderWidgetHostViewChildFrame special casing is temporary | 3799 // TODO(kenrb): RenderWidgetHostViewChildFrame special casing is temporary |
3800 // until RenderWidgetHost is attached to RenderFrameHost. We need to special | 3800 // until RenderWidgetHost is attached to RenderFrameHost. We need to special |
3801 // case this because RWH is still a base class of RenderViewHost, and child | 3801 // case this because RWH is still a base class of RenderViewHost, and child |
3802 // frame RWHVs are unique in that they do not have their own WebContents. | 3802 // frame RWHVs are unique in that they do not have their own WebContents. |
3803 if (frame_connector) { | 3803 if (for_subframe) { |
3804 RenderWidgetHostViewChildFrame* rwh_view_child = | 3804 RenderWidgetHostViewChildFrame* rwh_view_child = |
3805 new RenderWidgetHostViewChildFrame(render_view_host); | 3805 new RenderWidgetHostViewChildFrame(render_view_host); |
3806 frame_connector->set_view(rwh_view_child); | |
3807 rwh_view = rwh_view_child; | 3806 rwh_view = rwh_view_child; |
| 3807 static_cast<RenderViewHostImpl*>(render_view_host)->SetView(rwh_view); |
3808 } else { | 3808 } else { |
3809 rwh_view = view_->CreateViewForWidget(render_view_host); | 3809 rwh_view = view_->CreateViewForWidget(render_view_host); |
3810 } | 3810 } |
3811 | 3811 |
3812 // Now that the RenderView has been created, we need to tell it its size. | 3812 // Now that the RenderView has been created, we need to tell it its size. |
3813 if (rwh_view) | 3813 if (rwh_view) |
3814 rwh_view->SetSize(GetSizeForNewRenderView()); | 3814 rwh_view->SetSize(GetSizeForNewRenderView()); |
3815 | 3815 |
3816 // Make sure we use the correct starting page_id in the new RenderView. | 3816 // Make sure we use the correct starting page_id in the new RenderView. |
3817 UpdateMaxPageIDIfNecessary(render_view_host); | 3817 UpdateMaxPageIDIfNecessary(render_view_host); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3980 | 3980 |
3981 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3981 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
3982 if (!delegate_) | 3982 if (!delegate_) |
3983 return; | 3983 return; |
3984 const gfx::Size new_size = GetPreferredSize(); | 3984 const gfx::Size new_size = GetPreferredSize(); |
3985 if (new_size != old_size) | 3985 if (new_size != old_size) |
3986 delegate_->UpdatePreferredSize(this, new_size); | 3986 delegate_->UpdatePreferredSize(this, new_size); |
3987 } | 3987 } |
3988 | 3988 |
3989 } // namespace content | 3989 } // namespace content |
OLD | NEW |