Chromium Code Reviews| 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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 268 | 268 |
| 269 SiteInstanceImpl* RenderViewHostImpl::GetSiteInstance() const { | 269 SiteInstanceImpl* RenderViewHostImpl::GetSiteInstance() const { |
| 270 return instance_.get(); | 270 return instance_.get(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 bool RenderViewHostImpl::CreateRenderView( | 273 bool RenderViewHostImpl::CreateRenderView( |
| 274 int opener_frame_route_id, | 274 int opener_frame_route_id, |
| 275 int proxy_route_id, | 275 int proxy_route_id, |
| 276 int32_t max_page_id, | 276 int32_t max_page_id, |
| 277 const FrameReplicationState& replicated_frame_state, | 277 const FrameReplicationState& replicated_frame_state, |
| 278 bool window_was_created_with_opener) { | 278 bool window_was_created_with_opener, |
| 279 double zoom_level) { | |
| 279 TRACE_EVENT0("renderer_host,navigation", | 280 TRACE_EVENT0("renderer_host,navigation", |
| 280 "RenderViewHostImpl::CreateRenderView"); | 281 "RenderViewHostImpl::CreateRenderView"); |
| 281 DCHECK(!IsRenderViewLive()) << "Creating view twice"; | 282 DCHECK(!IsRenderViewLive()) << "Creating view twice"; |
| 282 | 283 |
| 283 // The process may (if we're sharing a process with another host that already | 284 // The process may (if we're sharing a process with another host that already |
| 284 // initialized it) or may not (we have our own process or the old process | 285 // initialized it) or may not (we have our own process or the old process |
| 285 // crashed) have been initialized. Calling Init multiple times will be | 286 // crashed) have been initialized. Calling Init multiple times will be |
| 286 // ignored, so this is safe. | 287 // ignored, so this is safe. |
| 287 if (!GetProcess()->Init()) | 288 if (!GetProcess()->Init()) |
| 288 return false; | 289 return false; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 params.swapped_out = !is_active_; | 331 params.swapped_out = !is_active_; |
| 331 params.replicated_frame_state = replicated_frame_state; | 332 params.replicated_frame_state = replicated_frame_state; |
| 332 params.proxy_routing_id = proxy_route_id; | 333 params.proxy_routing_id = proxy_route_id; |
| 333 params.hidden = GetWidget()->is_hidden(); | 334 params.hidden = GetWidget()->is_hidden(); |
| 334 params.never_visible = delegate_->IsNeverVisible(); | 335 params.never_visible = delegate_->IsNeverVisible(); |
| 335 params.window_was_created_with_opener = window_was_created_with_opener; | 336 params.window_was_created_with_opener = window_was_created_with_opener; |
| 336 params.next_page_id = next_page_id; | 337 params.next_page_id = next_page_id; |
| 337 params.enable_auto_resize = GetWidget()->auto_resize_enabled(); | 338 params.enable_auto_resize = GetWidget()->auto_resize_enabled(); |
| 338 params.min_size = GetWidget()->min_size_for_auto_resize(); | 339 params.min_size = GetWidget()->min_size_for_auto_resize(); |
| 339 params.max_size = GetWidget()->max_size_for_auto_resize(); | 340 params.max_size = GetWidget()->max_size_for_auto_resize(); |
| 341 params.preferred_subframe_zoom_level = zoom_level; | |
|
alexmos
2016/04/07 23:48:08
It seems that some similar looking params (e.g., n
wjmaclean
2016/04/08 20:13:29
It seemed to me that since RenderViewHostDelegate
ncarter (slow)
2016/04/11 22:17:03
I'm okay with either approach.
Practically, if yo
| |
| 340 GetWidget()->GetResizeParams(¶ms.initial_size); | 342 GetWidget()->GetResizeParams(¶ms.initial_size); |
| 341 | 343 |
| 342 if (!Send(new ViewMsg_New(params))) | 344 if (!Send(new ViewMsg_New(params))) |
| 343 return false; | 345 return false; |
| 344 GetWidget()->SetInitialRenderSizeParams(params.initial_size); | 346 GetWidget()->SetInitialRenderSizeParams(params.initial_size); |
| 345 | 347 |
| 346 // If the RWHV has not yet been set, the surface ID namespace will get | 348 // If the RWHV has not yet been set, the surface ID namespace will get |
| 347 // passed down by the call to SetView(). | 349 // passed down by the call to SetView(). |
| 348 if (GetWidget()->GetView()) { | 350 if (GetWidget()->GetView()) { |
| 349 Send(new ViewMsg_SetSurfaceIdNamespace( | 351 Send(new ViewMsg_SetSurfaceIdNamespace( |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1351 } else { | 1353 } else { |
| 1352 render_view_ready_on_process_launch_ = true; | 1354 render_view_ready_on_process_launch_ = true; |
| 1353 } | 1355 } |
| 1354 } | 1356 } |
| 1355 | 1357 |
| 1356 void RenderViewHostImpl::RenderViewReady() { | 1358 void RenderViewHostImpl::RenderViewReady() { |
| 1357 delegate_->RenderViewReady(this); | 1359 delegate_->RenderViewReady(this); |
| 1358 } | 1360 } |
| 1359 | 1361 |
| 1360 } // namespace content | 1362 } // namespace content |
| OLD | NEW |