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

Issue 268036: Implement the basic OS-level printing mechanics on Mac (Closed)

Created:
11 years, 2 months ago by stuartmorgan
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Implement the basic OS-level printing mechanics on Mac Part two of printing implementation on the Mac. This adds a Mac implementation of PrintSettings to get page setup and printer information, basic PDF->context rendering in PrintedDocument, and most of PrintingContext to allow getting print settings (both default and interactive). Reworks the message flow a bit when asking for print settings on the Mac, since it can only be done from the UI thread. Uses a modal dialog for now, but will later be modified further to allow for a sheet. BUG=13158 TEST=None; no user-visible effect yet. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=28857

Patch Set 1 #

Total comments: 14

Patch Set 2 : Address review comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+567 lines, -290 lines) Patch
M printing/print_settings.h View 2 chunks +8 lines, -0 lines 0 comments Download
M printing/print_settings.cc View 1 2 chunks +46 lines, -0 lines 0 comments Download
M printing/printed_document.h View 1 3 chunks +6 lines, -3 lines 0 comments Download
M printing/printed_document.cc View 1 4 chunks +5 lines, -124 lines 0 comments Download
A printing/printed_document_linux.cc View 1 chunk +28 lines, -0 lines 0 comments Download
A printing/printed_document_mac.cc View 1 chunk +53 lines, -0 lines 1 comment Download
A printing/printed_document_win.cc View 1 chunk +142 lines, -0 lines 0 comments Download
M printing/printing.gyp View 1 1 chunk +4 lines, -1 line 0 comments Download
M printing/printing_context.h View 1 5 chunks +35 lines, -11 lines 0 comments Download
D printing/printing_context_mac.cc View 1 chunk +0 lines, -117 lines 0 comments Download
A printing/printing_context_mac.mm View 1 1 chunk +206 lines, -0 lines 0 comments Download
M printing/printing_context_win.cc View 18 chunks +34 lines, -34 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
stuartmorgan
I'll be filing post-beta follow-up bugs for these TODOs once basic printing is landed.
11 years, 2 months ago (2009-10-12 19:00:46 UTC) #1
pink (ping after 24hrs)
All the ifdefs make me cry. Any thoughts on how to improve that for later ...
11 years, 2 months ago (2009-10-12 19:21:20 UTC) #2
Amanda Walker
Overall, LGTM with pink's suggestions. When I've refactored stuff from using HDC to using gfx::NativeDrawingContext, ...
11 years, 2 months ago (2009-10-12 20:14:20 UTC) #3
TVL
http://codereview.chromium.org/268036/diff/1/2 File printing/print_settings.cc (right): http://codereview.chromium.org/268036/diff/1/2#newcode91 Line 91: if (best_resolution.hRes > best_resolution.hRes) um.... should i make ...
11 years, 2 months ago (2009-10-12 20:19:55 UTC) #4
stuartmorgan
http://codereview.chromium.org/268036/diff/1/2 File printing/print_settings.cc (right): http://codereview.chromium.org/268036/diff/1/2#newcode84 Line 84: UInt32 resolution_count = 0; On 2009/10/12 19:21:21, pink ...
11 years, 2 months ago (2009-10-12 23:15:13 UTC) #5
Amanda Walker
LGTM
11 years, 2 months ago (2009-10-13 16:45:24 UTC) #6
Mark Mentovai
11 years, 2 months ago (2009-10-13 21:13:24 UTC) #7
http://codereview.chromium.org/268036/diff/5002/6006
File printing/printed_document_mac.cc (right):

http://codereview.chromium.org/268036/diff/5002/6006#newcode48
Line 48: CGContextDrawPDFDocument(context, target_rect, pdf_doc, page_number);
Deprecated.  The replacement is CGContextDrawPDFPage.

http://developer.apple.com/mac/library/DOCUMENTATION/GraphicsImaging/Referenc...

This causes errors with the 10.6 SDK:

.../src/printing/printed_document_mac.cc: In member function 'void
printing::PrintedDocument::RenderPrintedPage(const printing::PrintedPage&,
CGContext*) const':
.../src/printing/printed_document_mac.cc:48: warning: 'CGContextDrawPDFDocument'
is deprecated (declared at
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGContext.h:864)

Powered by Google App Engine
This is Rietveld 408576698