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

Side by Side Diff: printing/print_settings_initializer_mac.cc

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Moved elide text to print_settings_initializer Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/sys_string_conversions.h" 7 #include "base/sys_string_conversions.h"
8 #include "printing/header_footer_initializer.h"
8 #include "printing/print_settings.h" 9 #include "printing/print_settings.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 const PageRanges& new_ranges, 17 const PageRanges& new_ranges,
17 bool print_selection_only, 18 bool print_selection_only,
19 const DictionaryValue& header_footer_info,
18 PrintSettings* print_settings) { 20 PrintSettings* print_settings) {
19 DCHECK(print_settings); 21 DCHECK(print_settings);
20 22
21 print_settings->set_printer_name( 23 print_settings->set_printer_name(
22 base::SysCFStringRefToWide(PMPrinterGetName(printer))); 24 base::SysCFStringRefToWide(PMPrinterGetName(printer)));
23 print_settings->set_device_name( 25 print_settings->set_device_name(
24 base::SysCFStringRefToWide(PMPrinterGetID(printer))); 26 base::SysCFStringRefToWide(PMPrinterGetID(printer)));
25 print_settings->ranges = new_ranges; 27 print_settings->ranges = new_ranges;
26 28
27 PMOrientation orientation = kPMPortrait; 29 PMOrientation orientation = kPMPortrait;
(...skipping 30 matching lines...) Expand all
58 (paper_rect.bottom - paper_rect.top)); 60 (paper_rect.bottom - paper_rect.top));
59 gfx::Rect printable_area_device_units( 61 gfx::Rect printable_area_device_units(
60 (page_rect.left - paper_rect.left), 62 (page_rect.left - paper_rect.left),
61 (page_rect.top - paper_rect.top), 63 (page_rect.top - paper_rect.top),
62 (page_rect.right - page_rect.left), 64 (page_rect.right - page_rect.left),
63 (page_rect.bottom - page_rect.top)); 65 (page_rect.bottom - page_rect.top));
64 66
65 print_settings->SetPrinterPrintableArea(physical_size_device_units, 67 print_settings->SetPrinterPrintableArea(physical_size_device_units,
66 printable_area_device_units, 68 printable_area_device_units,
67 72); 69 72);
70 printing::HeaderFooterInitializer::InitHeaderFooterStrings(
71 header_footer_info, print_settings);
68 } 72 }
69 73
70 } // namespace printing 74 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698