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

Side by Side Diff: printing/print_settings_initializer_win.cc

Issue 7348010: Added Header and Footer support using Skia (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Changes based on Kausalya's comments 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_win.h" 5 #include "printing/print_settings_initializer_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "printing/header_footer_initializer.h"
9 #include "printing/print_settings.h" 10 #include "printing/print_settings.h"
10 11
11 namespace printing { 12 namespace printing {
12 13
13 // static 14 // static
14 void PrintSettingsInitializerWin::InitPrintSettings( 15 void PrintSettingsInitializerWin::InitPrintSettings(
15 HDC hdc, 16 HDC hdc,
16 const DEVMODE& dev_mode, 17 const DEVMODE& dev_mode,
17 const PageRanges& new_ranges, 18 const PageRanges& new_ranges,
18 const std::wstring& new_device_name, 19 const std::wstring& new_device_name,
19 bool print_selection_only, 20 bool print_selection_only,
21 const DictionaryValue& header_footer_info,
20 PrintSettings* print_settings) { 22 PrintSettings* print_settings) {
21 DCHECK(hdc); 23 DCHECK(hdc);
22 DCHECK(print_settings); 24 DCHECK(print_settings);
23 25
24 print_settings->set_printer_name(dev_mode.dmDeviceName); 26 print_settings->set_printer_name(dev_mode.dmDeviceName);
25 print_settings->set_device_name(new_device_name); 27 print_settings->set_device_name(new_device_name);
26 print_settings->ranges = new_ranges; 28 print_settings->ranges = new_ranges;
27 print_settings->set_landscape(dev_mode.dmOrientation == DMORIENT_LANDSCAPE); 29 print_settings->set_landscape(dev_mode.dmOrientation == DMORIENT_LANDSCAPE);
28 print_settings->selection_only = print_selection_only; 30 print_settings->selection_only = print_selection_only;
29 31
(...skipping 15 matching lines...) Expand all
45 gfx::Size physical_size_device_units(GetDeviceCaps(hdc, PHYSICALWIDTH), 47 gfx::Size physical_size_device_units(GetDeviceCaps(hdc, PHYSICALWIDTH),
46 GetDeviceCaps(hdc, PHYSICALHEIGHT)); 48 GetDeviceCaps(hdc, PHYSICALHEIGHT));
47 gfx::Rect printable_area_device_units(GetDeviceCaps(hdc, PHYSICALOFFSETX), 49 gfx::Rect printable_area_device_units(GetDeviceCaps(hdc, PHYSICALOFFSETX),
48 GetDeviceCaps(hdc, PHYSICALOFFSETY), 50 GetDeviceCaps(hdc, PHYSICALOFFSETY),
49 GetDeviceCaps(hdc, HORZRES), 51 GetDeviceCaps(hdc, HORZRES),
50 GetDeviceCaps(hdc, VERTRES)); 52 GetDeviceCaps(hdc, VERTRES));
51 53
52 print_settings->SetPrinterPrintableArea(physical_size_device_units, 54 print_settings->SetPrinterPrintableArea(physical_size_device_units,
53 printable_area_device_units, 55 printable_area_device_units,
54 dpi); 56 dpi);
57 printing::HeaderFooterInitializer::InitHeaderFooterStrings(
58 header_footer_info, print_settings);
55 } 59 }
56 60
57 } // namespace printing 61 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698