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

Issue 2948723002: Print Preview: Change print to cr.sendWithPromise (Closed)

Created:
3 years, 6 months ago by rbpotter
Modified:
3 years, 5 months ago
Reviewers:
Lei Zhang, dpapad
CC:
arv+watch_chromium.org, chromium-reviews, Lei Zhang
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Print Preview: Change print to cr.sendWithPromise Change the print message in print preview to send with promise, and use this to eliminate some global JS functions/CallJavascriptFunctionUnsafe: - onFileSelectionCompleted - onFileSelectionCancelled - printToCloud Also remove the print-failed webui event. BUG=717296 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2948723002 Cr-Commit-Position: refs/heads/master@{#482095} Committed: https://chromium.googlesource.com/chromium/src/+/d29fc0d18dc459eb543f50860d7d244694bebc5d

Patch Set 1 #

Patch Set 2 : Fix tests #

Patch Set 3 : nit #

Total comments: 3

Patch Set 4 : Address comments #

Total comments: 25

Patch Set 5 : Address comments #

Patch Set 6 : Fix #

Patch Set 7 : nits #

Total comments: 2

Patch Set 8 : Address comments and add close_ param #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+197 lines, -161 lines) Patch
M chrome/browser/resources/print_preview/native_layer.js View 1 2 3 4 5 6 7 7 chunks +14 lines, -47 lines 3 comments Download
M chrome/browser/resources/print_preview/print_preview.js View 1 2 3 4 5 6 7 11 chunks +48 lines, -30 lines 0 comments Download
M chrome/browser/ui/webui/print_preview/print_preview_handler.h View 1 2 3 4 5 6 7 5 chunks +20 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/print_preview/print_preview_handler.cc View 1 2 3 4 5 6 7 26 chunks +105 lines, -64 lines 2 comments Download
M chrome/browser/ui/webui/print_preview/print_preview_ui.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/print_preview/print_preview_ui.cc View 1 2 3 4 2 chunks +1 line, -4 lines 0 comments Download
M chrome/test/data/webui/print_preview/native_layer_stub.js View 1 2 3 5 chunks +7 lines, -7 lines 0 comments Download
M chrome/test/data/webui/print_preview/print_preview_tests.js View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 53 (36 generated)
rbpotter
Move the print message to cr.sendWithPromise to eliminate some global JS functions. Note that resolving ...
3 years, 6 months ago (2017-06-20 20:46:08 UTC) #12
dpapad
https://codereview.chromium.org/2948723002/diff/80001/chrome/browser/resources/print_preview/print_preview.js File chrome/browser/resources/print_preview/print_preview.js (right): https://codereview.chromium.org/2948723002/diff/80001/chrome/browser/resources/print_preview/print_preview.js#newcode588 chrome/browser/resources/print_preview/print_preview.js:588: * @param {?string=} data Data for cloud print if ...
3 years, 6 months ago (2017-06-22 01:15:22 UTC) #15
rbpotter
Accidentally deleted the wrong patchset (the one with comments) when trying to remove one I ...
3 years, 6 months ago (2017-06-22 23:30:36 UTC) #22
dpapad
LGTM! https://codereview.chromium.org/2948723002/diff/120001/chrome/test/data/webui/print_preview/native_layer_stub.js File chrome/test/data/webui/print_preview/native_layer_stub.js (right): https://codereview.chromium.org/2948723002/diff/120001/chrome/test/data/webui/print_preview/native_layer_stub.js#newcode102 chrome/test/data/webui/print_preview/native_layer_stub.js:102: this.methodCalled('print'); Nit (for a potential follow CL): Depending ...
3 years, 6 months ago (2017-06-23 00:13:57 UTC) #25
rbpotter
Thanks! Will wait to land this until I have a chance to double check the ...
3 years, 6 months ago (2017-06-23 00:30:24 UTC) #26
Lei Zhang
https://codereview.chromium.org/2948723002/diff/120001/chrome/browser/ui/webui/print_preview/print_preview_handler.cc File chrome/browser/ui/webui/print_preview/print_preview_handler.cc (right): https://codereview.chromium.org/2948723002/diff/120001/chrome/browser/ui/webui/print_preview/print_preview_handler.cc#newcode205 chrome/browser/ui/webui/print_preview/print_preview_handler.cc:205: // Get the print job settings dictionary from |args|. ...
3 years, 6 months ago (2017-06-23 08:30:01 UTC) #28
rbpotter
https://codereview.chromium.org/2948723002/diff/120001/chrome/browser/ui/webui/print_preview/print_preview_handler.cc File chrome/browser/ui/webui/print_preview/print_preview_handler.cc (right): https://codereview.chromium.org/2948723002/diff/120001/chrome/browser/ui/webui/print_preview/print_preview_handler.cc#newcode205 chrome/browser/ui/webui/print_preview/print_preview_handler.cc:205: // Get the print job settings dictionary from |args|. ...
3 years, 6 months ago (2017-06-23 17:34:30 UTC) #32
Lei Zhang
https://codereview.chromium.org/2948723002/diff/120001/chrome/browser/ui/webui/print_preview/print_preview_handler.cc File chrome/browser/ui/webui/print_preview/print_preview_handler.cc (right): https://codereview.chromium.org/2948723002/diff/120001/chrome/browser/ui/webui/print_preview/print_preview_handler.cc#newcode1445 chrome/browser/ui/webui/print_preview/print_preview_handler.cc:1445: pdf_callback_id_.clear(); On 2017/06/23 17:34:30, rbpotter wrote: > On 2017/06/23 ...
3 years, 6 months ago (2017-06-23 20:39:57 UTC) #35
rbpotter
FYI, modified the close_ function in print preview. The "closePrintPreviewDialog" message is sent only to ...
3 years, 6 months ago (2017-06-23 21:00:28 UTC) #36
dpapad
https://codereview.chromium.org/2948723002/diff/220001/chrome/browser/resources/print_preview/native_layer.js File chrome/browser/resources/print_preview/native_layer.js (right): https://codereview.chromium.org/2948723002/diff/220001/chrome/browser/resources/print_preview/native_layer.js#newcode515 chrome/browser/resources/print_preview/native_layer.js:515: chrome.send('closePrintPreviewDialog'); Nit (optional): chrome.send(isCancel ? 'closePrintPreviewDialog', 'dialogClose');
3 years, 6 months ago (2017-06-23 23:17:26 UTC) #40
Lei Zhang
lgtm
3 years, 6 months ago (2017-06-23 23:22:18 UTC) #41
rbpotter
https://codereview.chromium.org/2948723002/diff/220001/chrome/browser/resources/print_preview/native_layer.js File chrome/browser/resources/print_preview/native_layer.js (right): https://codereview.chromium.org/2948723002/diff/220001/chrome/browser/resources/print_preview/native_layer.js#newcode515 chrome/browser/resources/print_preview/native_layer.js:515: chrome.send('closePrintPreviewDialog'); On 2017/06/23 23:17:26, dpapad wrote: > Nit (optional): ...
3 years, 6 months ago (2017-06-23 23:34:36 UTC) #42
dpapad
https://codereview.chromium.org/2948723002/diff/220001/chrome/browser/resources/print_preview/native_layer.js File chrome/browser/resources/print_preview/native_layer.js (right): https://codereview.chromium.org/2948723002/diff/220001/chrome/browser/resources/print_preview/native_layer.js#newcode515 chrome/browser/resources/print_preview/native_layer.js:515: chrome.send('closePrintPreviewDialog'); On 2017/06/23 at 23:34:35, rbpotter wrote: > On ...
3 years, 6 months ago (2017-06-23 23:45:01 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2948723002/220001
3 years, 6 months ago (2017-06-24 00:42:57 UTC) #48
commit-bot: I haz the power
Committed patchset #8 (id:220001) as https://chromium.googlesource.com/chromium/src/+/d29fc0d18dc459eb543f50860d7d244694bebc5d
3 years, 6 months ago (2017-06-24 00:48:07 UTC) #51
Lei Zhang
https://codereview.chromium.org/2948723002/diff/220001/chrome/browser/ui/webui/print_preview/print_preview_handler.cc File chrome/browser/ui/webui/print_preview/print_preview_handler.cc (right): https://codereview.chromium.org/2948723002/diff/220001/chrome/browser/ui/webui/print_preview/print_preview_handler.cc#newcode872 chrome/browser/ui/webui/print_preview/print_preview_handler.cc:872: RejectJavascriptCallback(base::Value(callback_id), base::Value(-1)); Wait, don't we need to return after ...
3 years, 5 months ago (2017-07-11 05:11:10 UTC) #52
rbpotter
3 years, 5 months ago (2017-07-11 16:35:50 UTC) #53
Message was sent while issue was closed.
https://codereview.chromium.org/2948723002/diff/220001/chrome/browser/ui/webu...
File chrome/browser/ui/webui/print_preview/print_preview_handler.cc (right):

https://codereview.chromium.org/2948723002/diff/220001/chrome/browser/ui/webu...
chrome/browser/ui/webui/print_preview/print_preview_handler.cc:872:
RejectJavascriptCallback(base::Value(callback_id), base::Value(-1));
On 2017/07/11 05:11:10, Lei Zhang wrote:
> Wait, don't we need to return after a failure like this?

Yes for the case below. Should probably just crash here. The ticket
should never be empty unless something is wrong with the print preview
JS code. https://codereview.chromium.org/2980603002/

Powered by Google App Engine
This is Rietveld 408576698