Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1167)

Unified Diff: components/printing/renderer/print_web_view_helper.cc

Issue 2962983002: Print Preview: change getPreview to cr.sendWithPromise (Closed)
Patch Set: Address comments #2 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3a9e0ab7784bdf7ca11f7e52012d2a1f57b5af8c 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
+ : -1;
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));
}

Powered by Google App Engine
This is Rietveld 408576698