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

Issue 6533006: Print Preview: Hook up the print button to initiate printing without displaying a print dialog. (Closed)

Created:
9 years, 10 months ago by kmadhusu
Modified:
9 years, 7 months ago
CC:
chromium-reviews, pam+watch_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org, arv (Not doing code reviews)
Visibility:
Public.

Description

(1) Hook up the print button to send the pages to the default printer for printing without displaying a native dialog. (2) Made code changes to accept a print page range from the user and to print only those specified pages. BUG=none TEST=Enable print preview on mac, provide a valid page range and make sure print button in print preview works. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=77003

Patch Set 1 #

Patch Set 2 : 'Fixed style issues and build errors.' #

Patch Set 3 : '' #

Total comments: 24

Patch Set 4 : Fixed issues. #

Patch Set 5 : '' #

Patch Set 6 : Updated the CL. #

Patch Set 7 : '' #

Total comments: 18

Patch Set 8 : '' #

Patch Set 9 : '' #

Total comments: 17

Patch Set 10 : Address review comments. #

Patch Set 11 : Updated the CL. #

Total comments: 2

Patch Set 12 : Addressed review comments. #

Total comments: 20

Patch Set 13 : Addressed review comments. Moved print related IPC message handlers to printing_message_filter. #

Patch Set 14 : Fix a style issue. #

Patch Set 15 : Added more CHECK()s to validate the job settings dictionary. #

Patch Set 16 : '' #

Total comments: 43

Patch Set 17 : Addressed review comments. #

Patch Set 18 : '' #

Patch Set 19 : Updated the CL #

Patch Set 20 : Fix build errors #

Total comments: 2

Patch Set 21 : Addressed review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+353 lines, -49 lines) Patch
M chrome/browser/printing/print_job_worker.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/printing/print_job_worker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +36 lines, -0 lines 0 comments Download
M chrome/browser/printing/printer_query.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/printing/printer_query.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +33 lines, -14 lines 0 comments Download
M chrome/browser/printing/printing_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/printing/printing_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +42 lines, -0 lines 0 comments Download
M chrome/browser/resources/print_preview.html View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +6 lines, -9 lines 0 comments Download
M chrome/browser/resources/print_preview.js View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +70 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/print_preview_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/print_preview_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +25 lines, -3 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +9 lines, -1 line 0 comments Download
M chrome/renderer/print_web_view_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +12 lines, -1 line 0 comments Download
M chrome/renderer/print_web_view_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +38 lines, -6 lines 0 comments Download
M content/browser/renderer_host/render_view_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_view_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -2 lines 0 comments Download
M printing/printing_context.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +5 lines, -1 line 0 comments Download
M printing/printing_context_cairo.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M printing/printing_context_cairo.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +11 lines, -0 lines 0 comments Download
M printing/printing_context_mac.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M printing/printing_context_mac.mm View 1 2 3 4 5 6 7 8 2 chunks +14 lines, -1 line 0 comments Download
M printing/printing_context_win.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M printing/printing_context_win.cc View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
kmadhusu
thestig, jam: Please review printing code. jhawkins: Please review preview dom ui code. Thanks.
9 years, 10 months ago (2011-02-16 22:37:35 UTC) #1
James Hawkins
http://codereview.chromium.org/6533006/diff/47/chrome/browser/dom_ui/print_preview_handler.h File chrome/browser/dom_ui/print_preview_handler.h (right): http://codereview.chromium.org/6533006/diff/47/chrome/browser/dom_ui/print_preview_handler.h#newcode30 chrome/browser/dom_ui/print_preview_handler.h:30: void HandlePrint(const ListValue* args); Document this method. http://codereview.chromium.org/6533006/diff/47/chrome/browser/printing/print_job_worker.h File ...
9 years, 10 months ago (2011-02-16 22:58:21 UTC) #2
arv (Not doing code reviews)
FYI http://codereview.chromium.org/6533006/diff/47/chrome/browser/resources/print_preview.html File chrome/browser/resources/print_preview.html (right): http://codereview.chromium.org/6533006/diff/47/chrome/browser/resources/print_preview.html#newcode83 chrome/browser/resources/print_preview.html:83: console.log('in bottom script'); remove this http://codereview.chromium.org/6533006/diff/47/chrome/browser/resources/print_preview.js File chrome/browser/resources/print_preview.js ...
9 years, 10 months ago (2011-02-16 23:54:41 UTC) #3
kmadhusu
Thanks for your comments. Made code changes accordingly. Please review the new patch. http://codereview.chromium.org/6533006/diff/47/chrome/browser/dom_ui/print_preview_handler.h File ...
9 years, 10 months ago (2011-02-17 19:20:31 UTC) #4
Lei Zhang
You should have ask me to commit http://codereview.chromium.org/6479004/, rather than combine that CL with this ...
9 years, 10 months ago (2011-02-17 19:32:15 UTC) #5
kmadhusu
On 2011/02/17 19:32:15, Lei Zhang wrote: > You should have ask me to commit http://codereview.chromium.org/6479004/, ...
9 years, 10 months ago (2011-02-17 19:51:24 UTC) #6
kmadhusu
I have updated my CL. Please review my changes. Thanks.
9 years, 10 months ago (2011-02-17 23:27:04 UTC) #7
jam
http://codereview.chromium.org/6533006/diff/6031/chrome/browser/printing/print_job_worker.cc File chrome/browser/printing/print_job_worker.cc (right): http://codereview.chromium.org/6533006/diff/6031/chrome/browser/printing/print_job_worker.cc#newcode105 chrome/browser/printing/print_job_worker.cc:105: MessageLoop::current()->SetNestableTasksAllowed(false); why are you're doing this? http://codereview.chromium.org/6533006/diff/6031/chrome/browser/renderer_host/render_message_filter.cc File chrome/browser/renderer_host/render_message_filter.cc ...
9 years, 10 months ago (2011-02-18 01:55:06 UTC) #8
Lei Zhang
http://codereview.chromium.org/6533006/diff/6031/chrome/browser/dom_ui/print_preview_handler.h File chrome/browser/dom_ui/print_preview_handler.h (right): http://codereview.chromium.org/6533006/diff/6031/chrome/browser/dom_ui/print_preview_handler.h#newcode31 chrome/browser/dom_ui/print_preview_handler.h:31: // Get the job settings from Web UI and ...
9 years, 10 months ago (2011-02-18 05:21:42 UTC) #9
kmadhusu
Thanks for your comments. Made code changes accordingly. Please review the new patch. jam: I ...
9 years, 10 months ago (2011-02-21 01:30:26 UTC) #10
arv (Not doing code reviews)
http://codereview.chromium.org/6533006/diff/17001/chrome/browser/dom_ui/print_preview_handler.cc File chrome/browser/dom_ui/print_preview_handler.cc (right): http://codereview.chromium.org/6533006/diff/17001/chrome/browser/dom_ui/print_preview_handler.cc#newcode41 chrome/browser/dom_ui/print_preview_handler.cc:41: web_ui_util::GetJsonResponseFromFirstArgumentInList(args)); This looks wrong. Why does GetJSONResponseFromFirstArgumentInList return a ...
9 years, 10 months ago (2011-02-21 02:00:05 UTC) #11
kmadhusu
arv: Addressed review comments. Please review. http://codereview.chromium.org/6533006/diff/17001/chrome/browser/dom_ui/print_preview_handler.cc File chrome/browser/dom_ui/print_preview_handler.cc (right): http://codereview.chromium.org/6533006/diff/17001/chrome/browser/dom_ui/print_preview_handler.cc#newcode41 chrome/browser/dom_ui/print_preview_handler.cc:41: web_ui_util::GetJsonResponseFromFirstArgumentInList(args)); On 2011/02/21 ...
9 years, 10 months ago (2011-02-22 02:56:34 UTC) #12
arv (Not doing code reviews)
http://codereview.chromium.org/6533006/diff/17001/chrome/browser/dom_ui/print_preview_handler.cc File chrome/browser/dom_ui/print_preview_handler.cc (right): http://codereview.chromium.org/6533006/diff/17001/chrome/browser/dom_ui/print_preview_handler.cc#newcode41 chrome/browser/dom_ui/print_preview_handler.cc:41: web_ui_util::GetJsonResponseFromFirstArgumentInList(args)); On 2011/02/22 02:56:34, kmadhusu wrote: > On 2011/02/21 ...
9 years, 10 months ago (2011-02-23 19:38:52 UTC) #13
kmadhusu
arv: Addressed your comments. Please review print_preview.js and print_preview_handler.cc http://codereview.chromium.org/6533006/diff/20001/chrome/browser/resources/print_preview.js File chrome/browser/resources/print_preview.js (right): http://codereview.chromium.org/6533006/diff/20001/chrome/browser/resources/print_preview.js#newcode49 chrome/browser/resources/print_preview.js:49: ...
9 years, 10 months ago (2011-02-24 02:11:33 UTC) #14
Lei Zhang
http://codereview.chromium.org/6533006/diff/23001/chrome/browser/printing/print_job_worker.cc File chrome/browser/printing/print_job_worker.cc (right): http://codereview.chromium.org/6533006/diff/23001/chrome/browser/printing/print_job_worker.cc#newcode112 chrome/browser/printing/print_job_worker.cc:112: void PrintJobWorker::UpdatePrintSettings(const std::string& new_settings) { Have you considered parsing ...
9 years, 10 months ago (2011-02-24 03:49:32 UTC) #15
arv (Not doing code reviews)
The js/handler parts looks good with nits http://codereview.chromium.org/6533006/diff/23001/chrome/browser/resources/print_preview.js File chrome/browser/resources/print_preview.js (right): http://codereview.chromium.org/6533006/diff/23001/chrome/browser/resources/print_preview.js#newcode55 chrome/browser/resources/print_preview.js:55: printFrom = ...
9 years, 10 months ago (2011-02-24 23:21:02 UTC) #16
kmadhusu
arv: Addressed review comments. jam, thestig: Addressed review comments. Moved print related messages from render_message_filter ...
9 years, 9 months ago (2011-03-01 01:55:50 UTC) #17
jam
lgtm for the higher-level stuff, i defer to others for printing specific code. http://codereview.chromium.org/6533006/diff/35002/chrome/browser/printing/printing_message_filter.cc File ...
9 years, 9 months ago (2011-03-02 18:25:53 UTC) #18
Lei Zhang
I haven't finished reviewing everything yet, but here's a list of items that need to ...
9 years, 9 months ago (2011-03-02 23:28:53 UTC) #19
Lei Zhang
http://codereview.chromium.org/6533006/diff/35002/chrome/browser/printing/print_job_worker.h File chrome/browser/printing/print_job_worker.h (right): http://codereview.chromium.org/6533006/diff/35002/chrome/browser/printing/print_job_worker.h#newcode48 chrome/browser/printing/print_job_worker.h:48: void SetSettings(const DictionaryValue* const new_settings); You probably should mention ...
9 years, 9 months ago (2011-03-03 00:22:44 UTC) #20
kmadhusu
thestig: Addressed review comments. Please review my new patch. Thanks. http://codereview.chromium.org/6533006/diff/35002/chrome/browser/printing/print_job_worker.cc File chrome/browser/printing/print_job_worker.cc (right): http://codereview.chromium.org/6533006/diff/35002/chrome/browser/printing/print_job_worker.cc#newcode104 ...
9 years, 9 months ago (2011-03-04 19:39:02 UTC) #21
Lei Zhang
LGTM http://codereview.chromium.org/6533006/diff/45005/chrome/renderer/print_web_view_helper.cc File chrome/renderer/print_web_view_helper.cc (right): http://codereview.chromium.org/6533006/diff/45005/chrome/renderer/print_web_view_helper.cc#newcode526 chrome/renderer/print_web_view_helper.cc:526: (*print_pages_params_).params.document_cookie, nit: isn't this print_pages_params->params.document_cookie?
9 years, 9 months ago (2011-03-04 20:01:56 UTC) #22
kmadhusu
9 years, 9 months ago (2011-03-04 21:20:03 UTC) #23
thestig: Thanks for your comments.

http://codereview.chromium.org/6533006/diff/45005/chrome/renderer/print_web_v...
File chrome/renderer/print_web_view_helper.cc (right):

http://codereview.chromium.org/6533006/diff/45005/chrome/renderer/print_web_v...
chrome/renderer/print_web_view_helper.cc:526:
(*print_pages_params_).params.document_cookie,
On 2011/03/04 20:01:56, Lei Zhang wrote:
> nit: isn't this print_pages_params->params.document_cookie?

Done.

Powered by Google App Engine
This is Rietveld 408576698