OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 // static | 561 // static |
562 RenderFrameImpl* RenderFrameImpl::FromRoutingID(int routing_id) { | 562 RenderFrameImpl* RenderFrameImpl::FromRoutingID(int routing_id) { |
563 RoutingIDFrameMap::iterator iter = | 563 RoutingIDFrameMap::iterator iter = |
564 g_routing_id_frame_map.Get().find(routing_id); | 564 g_routing_id_frame_map.Get().find(routing_id); |
565 if (iter != g_routing_id_frame_map.Get().end()) | 565 if (iter != g_routing_id_frame_map.Get().end()) |
566 return iter->second; | 566 return iter->second; |
567 return NULL; | 567 return NULL; |
568 } | 568 } |
569 | 569 |
570 // static | 570 // static |
| 571 RenderFrameImpl* RenderFrameImpl::CreateMainFrame( |
| 572 RenderViewImpl* render_view, |
| 573 int32 routing_id, |
| 574 int32 widget_routing_id, |
| 575 int32 surface_id, |
| 576 bool hidden, |
| 577 const blink::WebScreenInfo& screen_info, |
| 578 CompositorDependencies* compositor_deps) { |
| 579 // A main frame RenderFrame must have a RenderWidget. |
| 580 DCHECK_NE(MSG_ROUTING_NONE, widget_routing_id); |
| 581 RenderFrameImpl* render_frame = Create(render_view, routing_id); |
| 582 WebLocalFrame* web_frame = |
| 583 WebLocalFrame::create(blink::WebTreeScopeType::Document, render_frame); |
| 584 render_frame->SetWebFrame(web_frame); |
| 585 // TODO(dcheng): This is a bit of a layering violation. Move this back to |
| 586 // RenderView once the main frame no longer needs a special frame widget. |
| 587 render_view->webview()->setMainFrame(web_frame); |
| 588 render_frame->render_widget_ = |
| 589 RenderWidget::CreateForFrame(widget_routing_id, surface_id, hidden, |
| 590 screen_info, compositor_deps, web_frame); |
| 591 // TODO(kenrb): Observing shouldn't be necessary when we sort out |
| 592 // WasShown and WasHidden, separating page-level visibility from |
| 593 // frame-level visibility. |
| 594 render_frame->render_widget_->RegisterRenderFrame(render_frame); |
| 595 return render_frame; |
| 596 } |
| 597 |
| 598 // static |
571 void RenderFrameImpl::CreateFrame( | 599 void RenderFrameImpl::CreateFrame( |
572 int routing_id, | 600 int routing_id, |
573 int parent_routing_id, | 601 int parent_routing_id, |
574 int previous_sibling_routing_id, | 602 int previous_sibling_routing_id, |
575 int proxy_routing_id, | 603 int proxy_routing_id, |
576 const FrameReplicationState& replicated_state, | 604 const FrameReplicationState& replicated_state, |
577 CompositorDependencies* compositor_deps, | 605 CompositorDependencies* compositor_deps, |
578 const FrameMsg_NewFrame_WidgetParams& widget_params) { | 606 const FrameMsg_NewFrame_WidgetParams& widget_params) { |
579 blink::WebLocalFrame* web_frame; | 607 blink::WebLocalFrame* web_frame; |
580 RenderFrameImpl* render_frame; | 608 RenderFrameImpl* render_frame; |
(...skipping 4533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5114 DCHECK(mojo_shell_); | 5142 DCHECK(mojo_shell_); |
5115 mojo::ServiceProviderPtr service_provider; | 5143 mojo::ServiceProviderPtr service_provider; |
5116 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 5144 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
5117 request->url = mojo::String::From(url); | 5145 request->url = mojo::String::From(url); |
5118 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), | 5146 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), |
5119 nullptr, nullptr); | 5147 nullptr, nullptr); |
5120 return service_provider.Pass(); | 5148 return service_provider.Pass(); |
5121 } | 5149 } |
5122 | 5150 |
5123 } // namespace content | 5151 } // namespace content |
OLD | NEW |