diff options
Diffstat (limited to 'chrome/browser/printing/print_preview_tab_controller.cc')
-rw-r--r-- | chrome/browser/printing/print_preview_tab_controller.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc index 6127443..afab88d 100644 --- a/chrome/browser/printing/print_preview_tab_controller.cc +++ b/chrome/browser/printing/print_preview_tab_controller.cc @@ -170,14 +170,26 @@ TabContents* PrintPreviewTabController::CreatePrintPreviewTab( TabContents* initiator_tab) { Browser* current_browser = BrowserList::FindBrowserWithID( initiator_tab->controller().window_id().id()); - if (!current_browser) - return NULL; + if (!current_browser) { + if (initiator_tab->delegate()->IsExternalTabContainer()) { + current_browser = Browser::CreateForType(Browser::TYPE_POPUP, + initiator_tab->profile()); + if (!current_browser) { + NOTREACHED() << "Failed to create popup browser window"; + return NULL; + } + } else { + return NULL; + } + } // Add a new tab next to initiator tab. browser::NavigateParams params(current_browser, GURL(chrome::kChromeUIPrintURL), PageTransition::LINK); params.disposition = NEW_FOREGROUND_TAB; + if (initiator_tab->delegate()->IsExternalTabContainer()) + params.disposition = NEW_POPUP; params.tabstrip_index = current_browser->tabstrip_model()-> GetWrapperIndex(initiator_tab) + 1; browser::Navigate(¶ms); |