| 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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 bool hidden, | 291 bool hidden, |
| 292 const blink::WebScreenInfo& screen_info, | 292 const blink::WebScreenInfo& screen_info, |
| 293 CompositorDependencies* compositor_deps, | 293 CompositorDependencies* compositor_deps, |
| 294 blink::WebLocalFrame* frame) { | 294 blink::WebLocalFrame* frame) { |
| 295 CHECK_NE(routing_id, MSG_ROUTING_NONE); | 295 CHECK_NE(routing_id, MSG_ROUTING_NONE); |
| 296 // TODO(avi): Before RenderViewImpl has-a RenderWidget, the browser passes the | 296 // TODO(avi): Before RenderViewImpl has-a RenderWidget, the browser passes the |
| 297 // same routing ID for both the view routing ID and the main frame widget | 297 // same routing ID for both the view routing ID and the main frame widget |
| 298 // routing ID. https://crbug.com/545684 | 298 // routing ID. https://crbug.com/545684 |
| 299 RenderViewImpl* view = RenderViewImpl::FromRoutingID(routing_id); | 299 RenderViewImpl* view = RenderViewImpl::FromRoutingID(routing_id); |
| 300 if (view) { | 300 if (view) { |
| 301 view->AttachWebFrameWidget( | 301 view->AttachWebFrameWidget(RenderWidget::CreateWebFrameWidget(view, frame)); |
| 302 RenderWidget::CreateWebFrameWidget(view->GetWidget(), frame)); | 302 return view; |
| 303 return view->GetWidget(); | |
| 304 } | 303 } |
| 305 scoped_refptr<RenderWidget> widget( | 304 scoped_refptr<RenderWidget> widget( |
| 306 new RenderWidget(compositor_deps, blink::WebPopupTypeNone, screen_info, | 305 new RenderWidget(compositor_deps, blink::WebPopupTypeNone, screen_info, |
| 307 false, hidden, false)); | 306 false, hidden, false)); |
| 308 widget->SetRoutingID(routing_id); | 307 widget->SetRoutingID(routing_id); |
| 309 widget->for_oopif_ = true; | 308 widget->for_oopif_ = true; |
| 310 // DoInit increments the reference count on |widget|, keeping it alive after | 309 // DoInit increments the reference count on |widget|, keeping it alive after |
| 311 // this function returns. | 310 // this function returns. |
| 312 if (widget->DoInit(MSG_ROUTING_NONE, | 311 if (widget->DoInit(MSG_ROUTING_NONE, |
| 313 RenderWidget::CreateWebFrameWidget(widget.get(), frame), | 312 RenderWidget::CreateWebFrameWidget(widget.get(), frame), |
| (...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2088 video_hole_frames_.RemoveObserver(frame); | 2087 video_hole_frames_.RemoveObserver(frame); |
| 2089 } | 2088 } |
| 2090 #endif // defined(VIDEO_HOLE) | 2089 #endif // defined(VIDEO_HOLE) |
| 2091 | 2090 |
| 2092 void RenderWidget::OnWaitNextFrameForTests(int routing_id) { | 2091 void RenderWidget::OnWaitNextFrameForTests(int routing_id) { |
| 2093 QueueMessage(new ViewHostMsg_WaitForNextFrameForTests_ACK(routing_id), | 2092 QueueMessage(new ViewHostMsg_WaitForNextFrameForTests_ACK(routing_id), |
| 2094 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); | 2093 MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE); |
| 2095 } | 2094 } |
| 2096 | 2095 |
| 2097 } // namespace content | 2096 } // namespace content |
| OLD | NEW |