| 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()));
|
| }
|
|
|