OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents_view.h" | 5 #include "chrome/browser/tab_contents/tab_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_view_host.h" | 8 #include "chrome/browser/renderer_host/render_view_host.h" |
9 #include "chrome/browser/renderer_host/render_widget_host.h" | 9 #include "chrome/browser/renderer_host/render_widget_host.h" |
10 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 10 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 if (tab_contents_->delegate()) | 52 if (tab_contents_->delegate()) |
53 tab_contents_->delegate()->TabContentsCreated(new_contents); | 53 tab_contents_->delegate()->TabContentsCreated(new_contents); |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 void TabContentsView::CreateNewWidget(int route_id, | 57 void TabContentsView::CreateNewWidget(int route_id, |
58 WebKit::WebPopupType popup_type) { | 58 WebKit::WebPopupType popup_type) { |
59 CreateNewWidgetInternal(route_id, popup_type); | 59 CreateNewWidgetInternal(route_id, popup_type); |
60 } | 60 } |
61 | 61 |
62 void TabContentsView::CreateNewFullscreenWidget( | 62 void TabContentsView::CreateNewFullscreenWidget(int route_id) { |
63 int route_id, WebKit::WebPopupType popup_type) { | 63 CreateNewFullscreenWidgetInternal(route_id); |
64 CreateNewFullscreenWidgetInternal(route_id, popup_type); | |
65 } | 64 } |
66 | 65 |
67 void TabContentsView::ShowCreatedWindow(int route_id, | 66 void TabContentsView::ShowCreatedWindow(int route_id, |
68 WindowOpenDisposition disposition, | 67 WindowOpenDisposition disposition, |
69 const gfx::Rect& initial_pos, | 68 const gfx::Rect& initial_pos, |
70 bool user_gesture) { | 69 bool user_gesture) { |
71 TabContents* contents = delegate_view_helper_.GetCreatedWindow(route_id); | 70 TabContents* contents = delegate_view_helper_.GetCreatedWindow(route_id); |
72 if (contents) { | 71 if (contents) { |
73 tab_contents()->AddNewContents(contents, disposition, initial_pos, | 72 tab_contents()->AddNewContents(contents, disposition, initial_pos, |
74 user_gesture); | 73 user_gesture); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 tab_contents_->delegate()->HandleMouseActivate(); | 137 tab_contents_->delegate()->HandleMouseActivate(); |
139 } | 138 } |
140 | 139 |
141 RenderWidgetHostView* TabContentsView::CreateNewWidgetInternal( | 140 RenderWidgetHostView* TabContentsView::CreateNewWidgetInternal( |
142 int route_id, WebKit::WebPopupType popup_type) { | 141 int route_id, WebKit::WebPopupType popup_type) { |
143 return delegate_view_helper_.CreateNewWidget(route_id, popup_type, | 142 return delegate_view_helper_.CreateNewWidget(route_id, popup_type, |
144 tab_contents()->render_view_host()->process()); | 143 tab_contents()->render_view_host()->process()); |
145 } | 144 } |
146 | 145 |
147 RenderWidgetHostView* TabContentsView::CreateNewFullscreenWidgetInternal( | 146 RenderWidgetHostView* TabContentsView::CreateNewFullscreenWidgetInternal( |
148 int route_id, WebKit::WebPopupType popup_type) { | 147 int route_id) { |
149 return delegate_view_helper_.CreateNewFullscreenWidget( | 148 return delegate_view_helper_.CreateNewFullscreenWidget( |
150 route_id, popup_type, tab_contents()->render_view_host()->process()); | 149 route_id, tab_contents()->render_view_host()->process()); |
151 } | 150 } |
152 | 151 |
153 void TabContentsView::ShowCreatedWidgetInternal( | 152 void TabContentsView::ShowCreatedWidgetInternal( |
154 RenderWidgetHostView* widget_host_view, const gfx::Rect& initial_pos) { | 153 RenderWidgetHostView* widget_host_view, const gfx::Rect& initial_pos) { |
155 if (tab_contents_->delegate()) | 154 if (tab_contents_->delegate()) |
156 tab_contents_->delegate()->RenderWidgetShowing(); | 155 tab_contents_->delegate()->RenderWidgetShowing(); |
157 | 156 |
158 widget_host_view->InitAsPopup(tab_contents_->GetRenderWidgetHostView(), | 157 widget_host_view->InitAsPopup(tab_contents_->GetRenderWidgetHostView(), |
159 initial_pos); | 158 initial_pos); |
160 widget_host_view->GetRenderWidgetHost()->Init(); | 159 widget_host_view->GetRenderWidgetHost()->Init(); |
161 } | 160 } |
162 | 161 |
163 void TabContentsView::ShowCreatedFullscreenWidgetInternal( | 162 void TabContentsView::ShowCreatedFullscreenWidgetInternal( |
164 RenderWidgetHostView* widget_host_view) { | 163 RenderWidgetHostView* widget_host_view) { |
165 if (tab_contents_->delegate()) | 164 if (tab_contents_->delegate()) |
166 tab_contents_->delegate()->RenderWidgetShowing(); | 165 tab_contents_->delegate()->RenderWidgetShowing(); |
167 | 166 |
168 widget_host_view->InitAsFullscreen(tab_contents_->GetRenderWidgetHostView()); | 167 widget_host_view->InitAsFullscreen(); |
169 widget_host_view->GetRenderWidgetHost()->Init(); | 168 widget_host_view->GetRenderWidgetHost()->Init(); |
170 } | 169 } |
OLD | NEW |