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

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

Issue 7721001: PrintPreview: Make ctrl-shift-p start the native print flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + merge conflicts fix Created 9 years, 4 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
Index: chrome/browser/printing/print_view_manager.cc
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index c9b8767b7e54f47579b99676476f68985e968619..b86573fcd8b428b4ba31be75c0755d003fe25617 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -88,6 +88,26 @@ bool PrintViewManager::PrintForSystemDialogNow() {
return PrintNowInternal(new PrintMsg_PrintForSystemDialog(routing_id()));
}
+bool PrintViewManager::AdvancedPrintNow() {
+ printing::PrintPreviewTabController* tab_controller =
+ printing::PrintPreviewTabController::GetInstance();
+ if (!tab_controller)
+ return false;
+ TabContents* print_preview_tab =
+ tab_controller->GetPrintPreviewForTab(tab_contents());
+ if (print_preview_tab) {
+ // Preview tab exist for current tab or current tab is preview tab.
+ if (!print_preview_tab->web_ui())
+ return false;
+ PrintPreviewUI* print_preview_ui =
+ static_cast<PrintPreviewUI*>(print_preview_tab->web_ui());
+ print_preview_ui->OnShowSystemDialog();
+ return true;
+ } else {
+ return PrintNow();
+ }
+}
+
bool PrintViewManager::PrintPreviewNow() {
return PrintNowInternal(new PrintMsg_InitiatePrintPreview(routing_id()));
}

Powered by Google App Engine
This is Rietveld 408576698