Chromium Code Reviews| Index: components/printing/renderer/print_web_view_helper.cc |
| diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc |
| index b92da73ac14a2a332f8bbf03cb33e84bb2bbd29e..5a1937a4fd4efd1539a78686b13439a8489374d8 100644 |
| --- a/components/printing/renderer/print_web_view_helper.cc |
| +++ b/components/printing/renderer/print_web_view_helper.cc |
| @@ -1188,9 +1188,10 @@ void PrintWebViewHelper::OnPrintPreview(const base::DictionaryValue& settings) { |
| print_preview_context_.source_node(), settings)) { |
| if (print_preview_context_.last_error() != PREVIEW_ERROR_BAD_SETTING) { |
| Send(new PrintHostMsg_PrintPreviewInvalidPrinterSettings( |
| - routing_id(), print_pages_params_ |
| - ? print_pages_params_->params.document_cookie |
| - : 0)); |
| + routing_id(), |
| + print_pages_params_ ? print_pages_params_->params.document_cookie : 0, |
| + print_pages_params_ ? print_pages_params_->params.preview_request_id |
| + : -1)); |
| notify_browser_of_print_failure_ = false; // Already sent. |
| } |
| DidFinishPrinting(FAIL_PREVIEW); |
| @@ -1576,9 +1577,13 @@ void PrintWebViewHelper::DidFinishPrinting(PrintingResult result) { |
| case FAIL_PREVIEW: |
| int cookie = |
| print_pages_params_ ? print_pages_params_->params.document_cookie : 0; |
| + int request_id = print_pages_params_ |
| + ? print_pages_params_->params.preview_request_id |
| + : 0; |
|
Lei Zhang
2017/06/29 19:25:46
Why do we use 0 here, but -1 on line 1194?
rbpotter
2017/06/29 20:44:10
Should always be -1, fixed.
|
| if (notify_browser_of_print_failure_) { |
| LOG(ERROR) << "CreatePreviewDocument failed"; |
| - Send(new PrintHostMsg_PrintPreviewFailed(routing_id(), cookie)); |
| + Send(new PrintHostMsg_PrintPreviewFailed(routing_id(), cookie, |
| + request_id)); |
| } else { |
| Send(new PrintHostMsg_PrintPreviewCancelled(routing_id(), cookie)); |
| } |