OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/tab_contents/web_contents_view.h" | 5 #include "chrome/browser/tab_contents/web_contents_view.h" |
6 | 6 |
7 #include "chrome/browser/renderer_host/render_process_host.h" | 7 #include "chrome/browser/renderer_host/render_process_host.h" |
8 #include "chrome/browser/renderer_host/render_widget_host.h" | 8 #include "chrome/browser/renderer_host/render_widget_host.h" |
9 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 9 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
10 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 10 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
(...skipping 13 matching lines...) Loading... |
24 } | 24 } |
25 } | 25 } |
26 | 26 |
27 void WebContentsView::CreateNewWindow(int route_id, | 27 void WebContentsView::CreateNewWindow(int route_id, |
28 base::WaitableEvent* modal_dialog_event) { | 28 base::WaitableEvent* modal_dialog_event) { |
29 // Create the new web contents. This will automatically create the new | 29 // Create the new web contents. This will automatically create the new |
30 // WebContentsView. In the future, we may want to create the view separately. | 30 // WebContentsView. In the future, we may want to create the view separately. |
31 WebContents* new_contents = | 31 WebContents* new_contents = |
32 new WebContents(web_contents()->profile(), | 32 new WebContents(web_contents()->profile(), |
33 web_contents()->GetSiteInstance(), | 33 web_contents()->GetSiteInstance(), |
34 web_contents()->render_view_factory_, | |
35 route_id, | 34 route_id, |
36 modal_dialog_event); | 35 modal_dialog_event); |
37 new_contents->SetupController(web_contents()->profile()); | 36 new_contents->SetupController(web_contents()->profile()); |
38 WebContentsView* new_view = new_contents->view(); | 37 WebContentsView* new_view = new_contents->view(); |
39 | 38 |
40 // TODO(brettw) it seems bogus that we have to call this function on the | 39 // TODO(brettw) it seems bogus that we have to call this function on the |
41 // newly created object and give it one of its own member variables. | 40 // newly created object and give it one of its own member variables. |
42 new_view->CreateViewForWidget(new_contents->render_view_host()); | 41 new_view->CreateViewForWidget(new_contents->render_view_host()); |
43 | 42 |
44 // Save the created window associated with the route so we can show it later. | 43 // Save the created window associated with the route so we can show it later. |
(...skipping 64 matching lines...) Loading... |
109 if (!widget_host->process()->channel()) { | 108 if (!widget_host->process()->channel()) { |
110 // The view has gone away or the renderer crashed. Nothing to do. | 109 // The view has gone away or the renderer crashed. Nothing to do. |
111 return; | 110 return; |
112 } | 111 } |
113 | 112 |
114 widget_host_view->InitAsPopup( | 113 widget_host_view->InitAsPopup( |
115 web_contents_->render_widget_host_view(), initial_pos); | 114 web_contents_->render_widget_host_view(), initial_pos); |
116 web_contents_->delegate()->RenderWidgetShowing(); | 115 web_contents_->delegate()->RenderWidgetShowing(); |
117 widget_host->Init(); | 116 widget_host->Init(); |
118 } | 117 } |
OLD | NEW |