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

Side by Side Diff: printing/print_settings_initializer_mac.cc

Issue 46623002: Move settings setup for PDF and cloud print into single location in PrintingContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "printing/print_settings_initializer_mac.h" 5 #include "printing/print_settings_initializer_mac.h"
6 6
7 #include "base/strings/sys_string_conversions.h" 7 #include "base/strings/sys_string_conversions.h"
8 #include "printing/print_settings.h" 8 #include "printing/print_settings.h"
9 #include "printing/units.h"
9 10
10 namespace printing { 11 namespace printing {
11 12
12 // static 13 // static
13 void PrintSettingsInitializerMac::InitPrintSettings( 14 void PrintSettingsInitializerMac::InitPrintSettings(
14 PMPrinter printer, 15 PMPrinter printer,
15 PMPageFormat page_format, 16 PMPageFormat page_format,
16 PrintSettings* print_settings) { 17 PrintSettings* print_settings) {
17 print_settings->set_device_name( 18 print_settings->set_device_name(
18 base::SysCFStringRefToUTF16(PMPrinterGetID(printer))); 19 base::SysCFStringRefToUTF16(PMPrinterGetID(printer)));
(...skipping 28 matching lines...) Expand all
47 // Device units are in points. Units per inch is 72. 48 // Device units are in points. Units per inch is 72.
48 gfx::Size physical_size_device_units( 49 gfx::Size physical_size_device_units(
49 (paper_rect.right - paper_rect.left), 50 (paper_rect.right - paper_rect.left),
50 (paper_rect.bottom - paper_rect.top)); 51 (paper_rect.bottom - paper_rect.top));
51 gfx::Rect printable_area_device_units( 52 gfx::Rect printable_area_device_units(
52 (page_rect.left - paper_rect.left), 53 (page_rect.left - paper_rect.left),
53 (page_rect.top - paper_rect.top), 54 (page_rect.top - paper_rect.top),
54 (page_rect.right - page_rect.left), 55 (page_rect.right - page_rect.left),
55 (page_rect.bottom - page_rect.top)); 56 (page_rect.bottom - page_rect.top));
56 57
58 DCHECK_EQ(print_settings->device_units_per_inch(), kPointsPerInch);
Lei Zhang 2013/11/01 18:27:13 nit: reverse the two arguments. DCHECK_EQ(expected
Vitaly Buka (NO REVIEWS) 2013/11/01 19:35:09 This looks like contradicts to example in logging.
57 print_settings->SetPrinterPrintableArea(physical_size_device_units, 59 print_settings->SetPrinterPrintableArea(physical_size_device_units,
58 printable_area_device_units, 60 printable_area_device_units,
59 72, false); 61 false);
60 } 62 }
61 63
62 } // namespace printing 64 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698