| 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 3878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3889 | 3889 |
| 3890 NavigationEntry* | 3890 NavigationEntry* |
| 3891 WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() { | 3891 WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() { |
| 3892 return controller_.GetLastCommittedEntry(); | 3892 return controller_.GetLastCommittedEntry(); |
| 3893 } | 3893 } |
| 3894 | 3894 |
| 3895 bool WebContentsImpl::CreateRenderViewForRenderManager( | 3895 bool WebContentsImpl::CreateRenderViewForRenderManager( |
| 3896 RenderViewHost* render_view_host, | 3896 RenderViewHost* render_view_host, |
| 3897 int opener_route_id, | 3897 int opener_route_id, |
| 3898 int proxy_routing_id, | 3898 int proxy_routing_id, |
| 3899 bool for_main_frame) { | 3899 CrossProcessFrameConnector* frame_connector) { |
| 3900 TRACE_EVENT0("browser", "WebContentsImpl::CreateRenderViewForRenderManager"); | 3900 TRACE_EVENT0("browser", "WebContentsImpl::CreateRenderViewForRenderManager"); |
| 3901 // Can be NULL during tests. | 3901 // Can be NULL during tests. |
| 3902 RenderWidgetHostViewBase* rwh_view; | 3902 RenderWidgetHostViewBase* rwh_view; |
| 3903 // TODO(kenrb): RenderWidgetHostViewChildFrame special casing is temporary | 3903 // TODO(kenrb): RenderWidgetHostViewChildFrame special casing is temporary |
| 3904 // until RenderWidgetHost is attached to RenderFrameHost. We need to special | 3904 // until RenderWidgetHost is attached to RenderFrameHost. We need to special |
| 3905 // case this because RWH is still a base class of RenderViewHost, and child | 3905 // case this because RWH is still a base class of RenderViewHost, and child |
| 3906 // frame RWHVs are unique in that they do not have their own WebContents. | 3906 // frame RWHVs are unique in that they do not have their own WebContents. |
| 3907 if (!for_main_frame) { | 3907 if (frame_connector) { |
| 3908 RenderWidgetHostViewChildFrame* rwh_view_child = | 3908 RenderWidgetHostViewChildFrame* rwh_view_child = |
| 3909 new RenderWidgetHostViewChildFrame(render_view_host); | 3909 new RenderWidgetHostViewChildFrame(render_view_host); |
| 3910 frame_connector->set_view(rwh_view_child); |
| 3910 rwh_view = rwh_view_child; | 3911 rwh_view = rwh_view_child; |
| 3911 } else { | 3912 } else { |
| 3912 rwh_view = view_->CreateViewForWidget(render_view_host); | 3913 rwh_view = view_->CreateViewForWidget(render_view_host); |
| 3913 } | 3914 } |
| 3914 | 3915 |
| 3915 // Now that the RenderView has been created, we need to tell it its size. | 3916 // Now that the RenderView has been created, we need to tell it its size. |
| 3916 if (rwh_view) | 3917 if (rwh_view) |
| 3917 rwh_view->SetSize(GetSizeForNewRenderView()); | 3918 rwh_view->SetSize(GetSizeForNewRenderView()); |
| 3918 | 3919 |
| 3919 // Make sure we use the correct starting page_id in the new RenderView. | 3920 // Make sure we use the correct starting page_id in the new RenderView. |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4089 | 4090 |
| 4090 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 4091 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
| 4091 if (!delegate_) | 4092 if (!delegate_) |
| 4092 return; | 4093 return; |
| 4093 const gfx::Size new_size = GetPreferredSize(); | 4094 const gfx::Size new_size = GetPreferredSize(); |
| 4094 if (new_size != old_size) | 4095 if (new_size != old_size) |
| 4095 delegate_->UpdatePreferredSize(this, new_size); | 4096 delegate_->UpdatePreferredSize(this, new_size); |
| 4096 } | 4097 } |
| 4097 | 4098 |
| 4098 } // namespace content | 4099 } // namespace content |
| OLD | NEW |