| Index: chrome/browser/printing/print_preview_message_handler.cc
|
| diff --git a/chrome/browser/printing/print_preview_message_handler.cc b/chrome/browser/printing/print_preview_message_handler.cc
|
| index d293d6f1d6e2829f2f43e1e7e3964fb66a627179..551d67a02d1201e7d9d7f72da658fd07a1e30d56 100644
|
| --- a/chrome/browser/printing/print_preview_message_handler.cc
|
| +++ b/chrome/browser/printing/print_preview_message_handler.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/memory/ref_counted.h"
|
| #include "chrome/browser/browser_process.h"
|
| +#include "chrome/browser/printing/background_printing_manager.h"
|
| #include "chrome/browser/printing/print_job_manager.h"
|
| #include "chrome/browser/printing/print_preview_tab_controller.h"
|
| #include "chrome/browser/printing/print_view_manager.h"
|
| @@ -114,7 +115,19 @@ void PrintPreviewMessageHandler::OnPrintPreviewFailed(int document_cookie) {
|
| // User might have closed it already.
|
| if (!print_preview_tab)
|
| return;
|
| - print_preview_tab->web_ui()->CallJavascriptFunction("printPreviewFailed");
|
| +
|
| + TabContentsWrapper* wrapper =
|
| + TabContentsWrapper::GetCurrentWrapperForContents(print_preview_tab);
|
| +
|
| + if (g_browser_process->background_printing_manager()->
|
| + HasTabContents(wrapper)) {
|
| + // Preview tab was hidden to serve the print request.
|
| + delete wrapper;
|
| + } else {
|
| + PrintPreviewUI* print_preview_ui =
|
| + static_cast<PrintPreviewUI*>(print_preview_tab->web_ui());
|
| + print_preview_ui->CallJavascriptFunction("printPreviewFailed");
|
| + }
|
| }
|
|
|
| bool PrintPreviewMessageHandler::OnMessageReceived(
|
|
|