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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 delegate_->GetSessionStorageNamespace(instance_.get())->id(); | 282 delegate_->GetSessionStorageNamespace(instance_.get())->id(); |
283 params.frame_name = frame_name; | 283 params.frame_name = frame_name; |
284 // Ensure the RenderView sets its opener correctly. | 284 // Ensure the RenderView sets its opener correctly. |
285 params.opener_route_id = opener_route_id; | 285 params.opener_route_id = opener_route_id; |
286 params.swapped_out = !is_active_; | 286 params.swapped_out = !is_active_; |
287 params.proxy_routing_id = proxy_route_id; | 287 params.proxy_routing_id = proxy_route_id; |
288 params.hidden = is_hidden(); | 288 params.hidden = is_hidden(); |
289 params.never_visible = delegate_->IsNeverVisible(); | 289 params.never_visible = delegate_->IsNeverVisible(); |
290 params.window_was_created_with_opener = window_was_created_with_opener; | 290 params.window_was_created_with_opener = window_was_created_with_opener; |
291 params.next_page_id = next_page_id; | 291 params.next_page_id = next_page_id; |
292 GetWebScreenInfo(¶ms.screen_info); | 292 params.enable_auto_resize = auto_resize_enabled(); |
| 293 params.min_size = min_size_for_auto_resize(); |
| 294 params.max_size = max_size_for_auto_resize(); |
| 295 GetResizeParams(¶ms.initial_size); |
293 | 296 |
294 Send(new ViewMsg_New(params)); | 297 if (!Send(new ViewMsg_New(params))) |
| 298 return false; |
| 299 SetInitialRenderSizeParams(params.initial_size); |
295 | 300 |
296 // If it's enabled, tell the renderer to set up the Javascript bindings for | 301 // If it's enabled, tell the renderer to set up the Javascript bindings for |
297 // sending messages back to the browser. | 302 // sending messages back to the browser. |
298 if (GetProcess()->IsIsolatedGuest()) | 303 if (GetProcess()->IsIsolatedGuest()) |
299 DCHECK_EQ(0, enabled_bindings_); | 304 DCHECK_EQ(0, enabled_bindings_); |
300 Send(new ViewMsg_AllowBindings(GetRoutingID(), enabled_bindings_)); | 305 Send(new ViewMsg_AllowBindings(GetRoutingID(), enabled_bindings_)); |
301 // Let our delegate know that we created a RenderView. | 306 // Let our delegate know that we created a RenderView. |
302 delegate_->RenderViewCreated(this); | 307 delegate_->RenderViewCreated(this); |
303 | 308 |
304 return true; | 309 return true; |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 void RenderViewHostImpl::DisableScrollbarsForThreshold(const gfx::Size& size) { | 1377 void RenderViewHostImpl::DisableScrollbarsForThreshold(const gfx::Size& size) { |
1373 Send(new ViewMsg_DisableScrollbarsForSmallWindows(GetRoutingID(), size)); | 1378 Send(new ViewMsg_DisableScrollbarsForSmallWindows(GetRoutingID(), size)); |
1374 } | 1379 } |
1375 | 1380 |
1376 void RenderViewHostImpl::EnablePreferredSizeMode() { | 1381 void RenderViewHostImpl::EnablePreferredSizeMode() { |
1377 Send(new ViewMsg_EnablePreferredSizeChangedMode(GetRoutingID())); | 1382 Send(new ViewMsg_EnablePreferredSizeChangedMode(GetRoutingID())); |
1378 } | 1383 } |
1379 | 1384 |
1380 void RenderViewHostImpl::EnableAutoResize(const gfx::Size& min_size, | 1385 void RenderViewHostImpl::EnableAutoResize(const gfx::Size& min_size, |
1381 const gfx::Size& max_size) { | 1386 const gfx::Size& max_size) { |
1382 SetShouldAutoResize(true); | 1387 SetAutoResize(true, min_size, max_size); |
1383 Send(new ViewMsg_EnableAutoResize(GetRoutingID(), min_size, max_size)); | 1388 Send(new ViewMsg_EnableAutoResize(GetRoutingID(), min_size, max_size)); |
1384 } | 1389 } |
1385 | 1390 |
1386 void RenderViewHostImpl::DisableAutoResize(const gfx::Size& new_size) { | 1391 void RenderViewHostImpl::DisableAutoResize(const gfx::Size& new_size) { |
1387 SetShouldAutoResize(false); | 1392 SetAutoResize(false, gfx::Size(), gfx::Size()); |
1388 Send(new ViewMsg_DisableAutoResize(GetRoutingID(), new_size)); | 1393 Send(new ViewMsg_DisableAutoResize(GetRoutingID(), new_size)); |
1389 if (!new_size.IsEmpty()) | 1394 if (!new_size.IsEmpty()) |
1390 GetView()->SetSize(new_size); | 1395 GetView()->SetSize(new_size); |
1391 } | 1396 } |
1392 | 1397 |
1393 void RenderViewHostImpl::CopyImageAt(int x, int y) { | 1398 void RenderViewHostImpl::CopyImageAt(int x, int y) { |
1394 Send(new ViewMsg_CopyImageAt(GetRoutingID(), x, y)); | 1399 Send(new ViewMsg_CopyImageAt(GetRoutingID(), x, y)); |
1395 } | 1400 } |
1396 | 1401 |
1397 void RenderViewHostImpl::SaveImageAt(int x, int y) { | 1402 void RenderViewHostImpl::SaveImageAt(int x, int y) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1464 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1460 | 1465 |
1461 frame_tree->ResetForMainFrameSwap(); | 1466 frame_tree->ResetForMainFrameSwap(); |
1462 } | 1467 } |
1463 | 1468 |
1464 void RenderViewHostImpl::SelectWordAroundCaret() { | 1469 void RenderViewHostImpl::SelectWordAroundCaret() { |
1465 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1470 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1466 } | 1471 } |
1467 | 1472 |
1468 } // namespace content | 1473 } // namespace content |
OLD | NEW |