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));
|
||||
}
|
||||
|
||||
//void PrintPreviewMessageHandler::OnPrintPreviewFailed(int document_cookie) {
|
||||
//StopWorker(document_cookie);
|
||||
|
||||
////PrintPreviewUI* print_preview_ui = GetPrintPreviewUI();
|
||||
////if (!print_preview_ui)
|
||||
////return;
|
||||
////print_preview_ui->OnPrintPreviewFailed();
|
||||
//}
|
||||
void PrintPreviewMessageHandler::OnPrintPreviewFailed(int document_cookie,
|
||||
int request_id) {
|
||||
StopWorker(document_cookie);
|
||||
RunPrintToPDFCallback(request_id, FAIL_PREVIEW);
|
||||
}
|
||||
|
||||
//void PrintPreviewMessageHandler::OnDidGetDefaultPageLayout(
|
||||
//const PageSizeMargins& page_layout_in_points,
|
||||
|
@ -193,8 +190,8 @@ bool PrintPreviewMessageHandler::OnMessageReceived(
|
|||
OnDidPreviewPage)
|
||||
IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting,
|
||||
OnMetafileReadyForPrinting)
|
||||
//IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewFailed,
|
||||
//OnPrintPreviewFailed)
|
||||
IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewFailed,
|
||||
OnPrintPreviewFailed)
|
||||
//IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetDefaultPageLayout,
|
||||
//OnDidGetDefaultPageLayout)
|
||||
//IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewCancelled,
|
||||
|
|
|
@ -73,7 +73,7 @@ class PrintPreviewMessageHandler
|
|||
void OnDidPreviewPage(const PrintHostMsg_DidPreviewPage_Params& params);
|
||||
void OnMetafileReadyForPrinting(
|
||||
const PrintHostMsg_DidPreviewDocument_Params& params);
|
||||
//void OnPrintPreviewFailed(int document_cookie);
|
||||
void OnPrintPreviewFailed(int document_cookie, int request_id);
|
||||
//void OnPrintPreviewCancelled(int document_cookie);
|
||||
//void OnInvalidPrinterSettings(int document_cookie);
|
||||
//void OnSetOptionsFromDocument(
|
||||
|
|
|
@ -332,6 +332,9 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
|
|||
IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount,
|
||||
PrintHostMsg_DidGetPreviewPageCount_Params /* params */)
|
||||
|
||||
IPC_MESSAGE_ROUTED2(PrintHostMsg_PrintPreviewFailed,
|
||||
int /* document cookie */,
|
||||
int /* request_id */);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// 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";
|
||||
//SetPrintPagesParams(settings)
|
||||
if (!UpdatePrintSettings(print_preview_context_.source_frame(),
|
||||
print_preview_context_.source_node(), settings)) {
|
||||
DidFinishPrinting(FAIL_PREVIEW);
|
||||
|
@ -938,6 +937,15 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) {
|
|||
Send(new PrintHostMsg_PrintingFailed(routing_id(), cookie));
|
||||
}
|
||||
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();
|
||||
print_pages_params_.reset();
|
||||
|
|
Loading…
Reference in a new issue