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

Side by Side Diff: printing/printing_context.cc

Issue 78143002: Use predefined margine for privet printing. (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/printing_context.h" 5 #include "printing/printing_context.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "printing/page_setup.h" 9 #include "printing/page_setup.h"
10 #include "printing/page_size_margins.h" 10 #include "printing/page_size_margins.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 bool open_in_external_preview = 73 bool open_in_external_preview =
74 job_settings.HasKey(kSettingOpenPDFInPreview); 74 job_settings.HasKey(kSettingOpenPDFInPreview);
75 75
76 if (!open_in_external_preview && (print_to_pdf || print_to_cloud || 76 if (!open_in_external_preview && (print_to_pdf || print_to_cloud ||
77 is_cloud_dialog || print_with_privet)) { 77 is_cloud_dialog || print_with_privet)) {
78 settings_.set_dpi(kDefaultPdfDpi); 78 settings_.set_dpi(kDefaultPdfDpi);
79 // Cloud print should get size and rect from capabilities received from 79 // Cloud print should get size and rect from capabilities received from
80 // server. 80 // server.
81 gfx::Size paper_size(GetPdfPaperSizeDeviceUnits()); 81 gfx::Size paper_size(GetPdfPaperSizeDeviceUnits());
82 gfx::Rect paper_rect(0, 0, paper_size.width(), paper_size.height()); 82 gfx::Rect paper_rect(0, 0, paper_size.width(), paper_size.height());
83 if (print_to_cloud) { 83 if (print_to_cloud || print_with_privet) {
84 paper_rect.Inset( 84 paper_rect.Inset(
85 kCloudPrintMarginInch * settings_.device_units_per_inch(), 85 kCloudPrintMarginInch * settings_.device_units_per_inch(),
86 kCloudPrintMarginInch * settings_.device_units_per_inch()); 86 kCloudPrintMarginInch * settings_.device_units_per_inch());
87 } 87 }
88 DCHECK_EQ(settings_.device_units_per_inch(), kDefaultPdfDpi); 88 DCHECK_EQ(settings_.device_units_per_inch(), kDefaultPdfDpi);
89 settings_.SetPrinterPrintableArea(paper_size, paper_rect, true); 89 settings_.SetPrinterPrintableArea(paper_size, paper_rect, true);
90 return OK; 90 return OK;
91 } 91 }
92 92
93 return UpdatePrinterSettings(open_in_external_preview); 93 return UpdatePrinterSettings(open_in_external_preview);
94 } 94 }
95 95
96 } // namespace printing 96 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698