summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-02 00:16:00 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-02 00:16:00 +0000
commit9a05b75028274c6178930613b8f396a2e982d26b (patch)
tree5d09b31c099adef1c8ec2c09d0123b5daa95dff7
parentff5a268a8b1d8c3f0ac1986a69c3410e3dcd94ca (diff)
downloadchromium_src-9a05b75028274c6178930613b8f396a2e982d26b.zip
chromium_src-9a05b75028274c6178930613b8f396a2e982d26b.tar.gz
chromium_src-9a05b75028274c6178930613b8f396a2e982d26b.tar.bz2
Support PDF print preview in ChromeFrame by opening the preview in a new Chrome popup window.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=83661 BUG=83661 Review URL: http://codereview.chromium.org/6962051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87554 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/printing/print_preview_tab_controller.cc16
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(&params);