Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6807)

Unified Diff: chrome/browser/printing/print_preview_tab_controller.cc

Issue 6962051: Support PDF print preview in ChromeFrame by opening the preview in a new Chrome popup window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_preview_tab_controller.cc
===================================================================
--- chrome/browser/printing/print_preview_tab_controller.cc (revision 87490)
+++ chrome/browser/printing/print_preview_tab_controller.cc (working copy)
@@ -170,14 +170,26 @@
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698