Add preview failed error.
This commit is contained in:
parent
8572ccb807
commit
cef177abc4
4 changed files with 20 additions and 12 deletions
|
@ -141,14 +141,11 @@ void PrintPreviewMessageHandler::OnMetafileReadyForPrinting(
|
||||||
params.preview_request_id));
|
params.preview_request_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
//void PrintPreviewMessageHandler::OnPrintPreviewFailed(int document_cookie) {
|
void PrintPreviewMessageHandler::OnPrintPreviewFailed(int document_cookie,
|
||||||
//StopWorker(document_cookie);
|
int request_id) {
|
||||||
|
StopWorker(document_cookie);
|
||||||
////PrintPreviewUI* print_preview_ui = GetPrintPreviewUI();
|
RunPrintToPDFCallback(request_id, FAIL_PREVIEW);
|
||||||
////if (!print_preview_ui)
|
}
|
||||||
////return;
|
|
||||||
////print_preview_ui->OnPrintPreviewFailed();
|
|
||||||
//}
|
|
||||||
|
|
||||||
//void PrintPreviewMessageHandler::OnDidGetDefaultPageLayout(
|
//void PrintPreviewMessageHandler::OnDidGetDefaultPageLayout(
|
||||||
//const PageSizeMargins& page_layout_in_points,
|
//const PageSizeMargins& page_layout_in_points,
|
||||||
|
@ -193,8 +190,8 @@ bool PrintPreviewMessageHandler::OnMessageReceived(
|
||||||
OnDidPreviewPage)
|
OnDidPreviewPage)
|
||||||
IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting,
|
IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting,
|
||||||
OnMetafileReadyForPrinting)
|
OnMetafileReadyForPrinting)
|
||||||
//IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewFailed,
|
IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewFailed,
|
||||||
//OnPrintPreviewFailed)
|
OnPrintPreviewFailed)
|
||||||
//IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetDefaultPageLayout,
|
//IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetDefaultPageLayout,
|
||||||
//OnDidGetDefaultPageLayout)
|
//OnDidGetDefaultPageLayout)
|
||||||
//IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewCancelled,
|
//IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewCancelled,
|
||||||
|
|
|
@ -73,7 +73,7 @@ class PrintPreviewMessageHandler
|
||||||
void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params);
|
void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params);
|
||||||
void OnMetafileReadyForPrinting(
|
void OnMetafileReadyForPrinting(
|
||||||
const PrintHostMsg_DidPreviewDocument_Params& params);
|
const PrintHostMsg_DidPreviewDocument_Params& params);
|
||||||
//void OnPrintPreviewFailed(int document_cookie);
|
void OnPrintPreviewFailed(int document_cookie, int request_id);
|
||||||
//void OnPrintPreviewCancelled(int document_cookie);
|
//void OnPrintPreviewCancelled(int document_cookie);
|
||||||
//void OnInvalidPrinterSettings(int document_cookie);
|
//void OnInvalidPrinterSettings(int document_cookie);
|
||||||
//void OnSetOptionsFromDocument(
|
//void OnSetOptionsFromDocument(
|
||||||
|
|
|
@ -332,6 +332,9 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
|
||||||
IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount,
|
IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount,
|
||||||
PrintHostMsg_DidGetPreviewPageCount_Params /* params */)
|
PrintHostMsg_DidGetPreviewPageCount_Params /* params */)
|
||||||
|
|
||||||
|
IPC_MESSAGE_ROUTED2(PrintHostMsg_PrintPreviewFailed,
|
||||||
|
int /* document cookie */,
|
||||||
|
int /* request_id */);
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
// Tell the utility process to start rendering the given PDF into a metafile.
|
// Tell the utility process to start rendering the given PDF into a metafile.
|
||||||
|
|
|
@ -724,7 +724,6 @@ void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) {
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(ERROR) << "OnPrintPreview2";
|
LOG(ERROR) << "OnPrintPreview2";
|
||||||
//SetPrintPagesParams(settings)
|
|
||||||
if (!UpdatePrintSettings(print_preview_context_.source_frame(),
|
if (!UpdatePrintSettings(print_preview_context_.source_frame(),
|
||||||
print_preview_context_.source_node(), settings)) {
|
print_preview_context_.source_node(), settings)) {
|
||||||
DidFinishPrinting(FAIL_PREVIEW);
|
DidFinishPrinting(FAIL_PREVIEW);
|
||||||
|
@ -938,6 +937,15 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
|
||||||
Send(new PrintHostMsg_PrintingFailed(routing_id(), cookie));
|
Send(new PrintHostMsg_PrintingFailed(routing_id(), cookie));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FAIL_PREVIEW:
|
||||||
|
LOG(ERROR) << "PREVIEW FAILED.";
|
||||||
|
if (print_pages_params_) {
|
||||||
|
Send(new PrintHostMsg_PrintPreviewFailed(routing_id(),
|
||||||
|
print_pages_params_->params.document_cookie,
|
||||||
|
print_pages_params_->params.preview_request_id));
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
prep_frame_view_.reset();
|
prep_frame_view_.reset();
|
||||||
print_pages_params_.reset();
|
print_pages_params_.reset();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue