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/external_tab_container_win.h" | 5 #include "chrome/browser/external_tab_container_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 0); | 1170 0); |
1171 | 1171 |
1172 external_tab_view_->SetLayoutManager(layout); | 1172 external_tab_view_->SetLayoutManager(layout); |
1173 | 1173 |
1174 layout->StartRow(0, 0); | 1174 layout->StartRow(0, 0); |
1175 layout->AddView(info_bar_container); | 1175 layout->AddView(info_bar_container); |
1176 layout->StartRow(1, 0); | 1176 layout->StartRow(1, 0); |
1177 layout->AddView(tab_contents_container_); | 1177 layout->AddView(tab_contents_container_); |
1178 GetWidget()->SetContentsView(external_tab_view_); | 1178 GetWidget()->SetContentsView(external_tab_view_); |
1179 // Note that SetTabContents must be called after AddChildView is called | 1179 // Note that SetTabContents must be called after AddChildView is called |
1180 tab_contents_container_->ChangeTabContents(tab_contents()); | 1180 tab_contents_container_->ChangeWebContents(web_contents()); |
1181 } | 1181 } |
1182 | 1182 |
1183 TemporaryPopupExternalTabContainer::TemporaryPopupExternalTabContainer( | 1183 TemporaryPopupExternalTabContainer::TemporaryPopupExternalTabContainer( |
1184 AutomationProvider* automation, | 1184 AutomationProvider* automation, |
1185 AutomationResourceMessageFilter* filter) | 1185 AutomationResourceMessageFilter* filter) |
1186 : ExternalTabContainer(automation, filter) { | 1186 : ExternalTabContainer(automation, filter) { |
1187 } | 1187 } |
1188 | 1188 |
1189 TemporaryPopupExternalTabContainer::~TemporaryPopupExternalTabContainer() { | 1189 TemporaryPopupExternalTabContainer::~TemporaryPopupExternalTabContainer() { |
1190 DVLOG(1) << __FUNCTION__; | 1190 DVLOG(1) << __FUNCTION__; |
1191 } | 1191 } |
1192 | 1192 |
1193 WebContents* TemporaryPopupExternalTabContainer::OpenURLFromTab( | 1193 WebContents* TemporaryPopupExternalTabContainer::OpenURLFromTab( |
1194 WebContents* source, | 1194 WebContents* source, |
1195 const OpenURLParams& params) { | 1195 const OpenURLParams& params) { |
1196 if (!automation_) | 1196 if (!automation_) |
1197 return NULL; | 1197 return NULL; |
1198 | 1198 |
1199 OpenURLParams forward_params = params; | 1199 OpenURLParams forward_params = params; |
1200 if (params.disposition == CURRENT_TAB) { | 1200 if (params.disposition == CURRENT_TAB) { |
1201 DCHECK(route_all_top_level_navigations_); | 1201 DCHECK(route_all_top_level_navigations_); |
1202 forward_params.disposition = NEW_FOREGROUND_TAB; | 1202 forward_params.disposition = NEW_FOREGROUND_TAB; |
1203 } | 1203 } |
1204 WebContents* new_contents = | 1204 WebContents* new_contents = |
1205 ExternalTabContainer::OpenURLFromTab(source, forward_params); | 1205 ExternalTabContainer::OpenURLFromTab(source, forward_params); |
1206 // support only one navigation for a dummy tab before it is killed. | 1206 // support only one navigation for a dummy tab before it is killed. |
1207 ::DestroyWindow(GetNativeView()); | 1207 ::DestroyWindow(GetNativeView()); |
1208 return new_contents; | 1208 return new_contents; |
1209 } | 1209 } |
OLD | NEW |