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 return delegate_; | 268 return delegate_; |
269 } | 269 } |
270 | 270 |
271 SiteInstance* RenderViewHostImpl::GetSiteInstance() const { | 271 SiteInstance* RenderViewHostImpl::GetSiteInstance() const { |
272 return instance_.get(); | 272 return instance_.get(); |
273 } | 273 } |
274 | 274 |
275 bool RenderViewHostImpl::CreateRenderView( | 275 bool RenderViewHostImpl::CreateRenderView( |
276 const base::string16& frame_name, | 276 const base::string16& frame_name, |
277 int opener_route_id, | 277 int opener_route_id, |
278 int32 max_page_id) { | 278 int32 max_page_id, |
| 279 bool window_was_created_with_opener) { |
279 TRACE_EVENT0("renderer_host", "RenderViewHostImpl::CreateRenderView"); | 280 TRACE_EVENT0("renderer_host", "RenderViewHostImpl::CreateRenderView"); |
280 DCHECK(!IsRenderViewLive()) << "Creating view twice"; | 281 DCHECK(!IsRenderViewLive()) << "Creating view twice"; |
281 | 282 |
282 // The process may (if we're sharing a process with another host that already | 283 // The process may (if we're sharing a process with another host that already |
283 // initialized it) or may not (we have our own process or the old process | 284 // initialized it) or may not (we have our own process or the old process |
284 // crashed) have been initialized. Calling Init multiple times will be | 285 // crashed) have been initialized. Calling Init multiple times will be |
285 // ignored, so this is safe. | 286 // ignored, so this is safe. |
286 if (!GetProcess()->Init()) | 287 if (!GetProcess()->Init()) |
287 return false; | 288 return false; |
288 DCHECK(GetProcess()->HasConnection()); | 289 DCHECK(GetProcess()->HasConnection()); |
(...skipping 18 matching lines...) Expand all Loading... |
307 params.main_frame_routing_id = main_frame_routing_id_; | 308 params.main_frame_routing_id = main_frame_routing_id_; |
308 params.surface_id = surface_id(); | 309 params.surface_id = surface_id(); |
309 params.session_storage_namespace_id = | 310 params.session_storage_namespace_id = |
310 delegate_->GetSessionStorageNamespace(instance_)->id(); | 311 delegate_->GetSessionStorageNamespace(instance_)->id(); |
311 params.frame_name = frame_name; | 312 params.frame_name = frame_name; |
312 // Ensure the RenderView sets its opener correctly. | 313 // Ensure the RenderView sets its opener correctly. |
313 params.opener_route_id = opener_route_id; | 314 params.opener_route_id = opener_route_id; |
314 params.swapped_out = !IsRVHStateActive(rvh_state_); | 315 params.swapped_out = !IsRVHStateActive(rvh_state_); |
315 params.hidden = is_hidden(); | 316 params.hidden = is_hidden(); |
316 params.never_visible = delegate_->IsNeverVisible(); | 317 params.never_visible = delegate_->IsNeverVisible(); |
| 318 params.window_was_created_with_opener = window_was_created_with_opener; |
317 params.next_page_id = next_page_id; | 319 params.next_page_id = next_page_id; |
318 GetWebScreenInfo(¶ms.screen_info); | 320 GetWebScreenInfo(¶ms.screen_info); |
319 params.accessibility_mode = accessibility_mode(); | 321 params.accessibility_mode = accessibility_mode(); |
320 | 322 |
321 Send(new ViewMsg_New(params)); | 323 Send(new ViewMsg_New(params)); |
322 | 324 |
323 // If it's enabled, tell the renderer to set up the Javascript bindings for | 325 // If it's enabled, tell the renderer to set up the Javascript bindings for |
324 // sending messages back to the browser. | 326 // sending messages back to the browser. |
325 if (GetProcess()->IsGuest()) | 327 if (GetProcess()->IsGuest()) |
326 DCHECK_EQ(0, enabled_bindings_); | 328 DCHECK_EQ(0, enabled_bindings_); |
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1779 return true; | 1781 return true; |
1780 } | 1782 } |
1781 | 1783 |
1782 void RenderViewHostImpl::AttachToFrameTree() { | 1784 void RenderViewHostImpl::AttachToFrameTree() { |
1783 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1785 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1784 | 1786 |
1785 frame_tree->ResetForMainFrameSwap(); | 1787 frame_tree->ResetForMainFrameSwap(); |
1786 } | 1788 } |
1787 | 1789 |
1788 } // namespace content | 1790 } // namespace content |
OLD | NEW |