| 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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 // ExternalTabContainer, TabContentsDelegate implementation: | 360 // ExternalTabContainer, TabContentsDelegate implementation: |
| 361 | 361 |
| 362 // TODO(adriansc): Remove this method once refactoring changed all call sites. | 362 // TODO(adriansc): Remove this method once refactoring changed all call sites. |
| 363 TabContents* ExternalTabContainer::OpenURLFromTab( | 363 TabContents* ExternalTabContainer::OpenURLFromTab( |
| 364 TabContents* source, | 364 TabContents* source, |
| 365 const GURL& url, | 365 const GURL& url, |
| 366 const GURL& referrer, | 366 const GURL& referrer, |
| 367 WindowOpenDisposition disposition, | 367 WindowOpenDisposition disposition, |
| 368 content::PageTransition transition) { | 368 content::PageTransition transition) { |
| 369 return OpenURLFromTab(source, | 369 return OpenURLFromTab(source, |
| 370 OpenURLParams(url, referrer, disposition, transition)); | 370 OpenURLParams(url, referrer, disposition, transition, |
| 371 false)); |
| 371 } | 372 } |
| 372 | 373 |
| 373 TabContents* ExternalTabContainer::OpenURLFromTab(TabContents* source, | 374 TabContents* ExternalTabContainer::OpenURLFromTab(TabContents* source, |
| 374 const OpenURLParams& params) { | 375 const OpenURLParams& params) { |
| 375 if (pending()) { | 376 if (pending()) { |
| 376 pending_open_url_requests_.push_back(params); | 377 pending_open_url_requests_.push_back(params); |
| 377 return NULL; | 378 return NULL; |
| 378 } | 379 } |
| 379 | 380 |
| 380 switch (params.disposition) { | 381 switch (params.disposition) { |
| (...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 } | 1194 } |
| 1194 | 1195 |
| 1195 TemporaryPopupExternalTabContainer::~TemporaryPopupExternalTabContainer() { | 1196 TemporaryPopupExternalTabContainer::~TemporaryPopupExternalTabContainer() { |
| 1196 DVLOG(1) << __FUNCTION__; | 1197 DVLOG(1) << __FUNCTION__; |
| 1197 } | 1198 } |
| 1198 | 1199 |
| 1199 TabContents* TemporaryPopupExternalTabContainer::OpenURLFromTab( | 1200 TabContents* TemporaryPopupExternalTabContainer::OpenURLFromTab( |
| 1200 TabContents* source, const GURL& url, const GURL& referrer, | 1201 TabContents* source, const GURL& url, const GURL& referrer, |
| 1201 WindowOpenDisposition disposition, content::PageTransition transition) { | 1202 WindowOpenDisposition disposition, content::PageTransition transition) { |
| 1202 return OpenURLFromTab(source, | 1203 return OpenURLFromTab(source, |
| 1203 OpenURLParams(url, referrer, disposition, transition)); | 1204 OpenURLParams(url, referrer, disposition, transition, |
| 1205 false)); |
| 1204 } | 1206 } |
| 1205 | 1207 |
| 1206 TabContents* TemporaryPopupExternalTabContainer::OpenURLFromTab( | 1208 TabContents* TemporaryPopupExternalTabContainer::OpenURLFromTab( |
| 1207 TabContents* source, | 1209 TabContents* source, |
| 1208 const OpenURLParams& params) { | 1210 const OpenURLParams& params) { |
| 1209 if (!automation_) | 1211 if (!automation_) |
| 1210 return NULL; | 1212 return NULL; |
| 1211 | 1213 |
| 1212 OpenURLParams forward_params = params; | 1214 OpenURLParams forward_params = params; |
| 1213 if (params.disposition == CURRENT_TAB) { | 1215 if (params.disposition == CURRENT_TAB) { |
| 1214 DCHECK(route_all_top_level_navigations_); | 1216 DCHECK(route_all_top_level_navigations_); |
| 1215 forward_params.disposition = NEW_FOREGROUND_TAB; | 1217 forward_params.disposition = NEW_FOREGROUND_TAB; |
| 1216 } | 1218 } |
| 1217 TabContents* new_contents = | 1219 TabContents* new_contents = |
| 1218 ExternalTabContainer::OpenURLFromTab(source, forward_params); | 1220 ExternalTabContainer::OpenURLFromTab(source, forward_params); |
| 1219 // support only one navigation for a dummy tab before it is killed. | 1221 // support only one navigation for a dummy tab before it is killed. |
| 1220 ::DestroyWindow(GetNativeView()); | 1222 ::DestroyWindow(GetNativeView()); |
| 1221 return new_contents; | 1223 return new_contents; |
| 1222 } | 1224 } |
| OLD | NEW |