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

Side by Side Diff: printing/printing_context_android.cc

Issue 75273005: Set DPI before using GetPdfPaperSizeDeviceUnits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_android.h" 5 #include "printing/printing_context_android.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 height = Round(ConvertUnitDouble(height, kInchToMil, 1.0) * dpi); 131 height = Round(ConvertUnitDouble(height, kInchToMil, 1.0) * dpi);
132 SetSizes(&settings_, dpi, width, height); 132 SetSizes(&settings_, dpi, width, height);
133 133
134 callback_.Run(OK); 134 callback_.Run(OK);
135 } 135 }
136 136
137 PrintingContext::Result PrintingContextAndroid::UseDefaultSettings() { 137 PrintingContext::Result PrintingContextAndroid::UseDefaultSettings() {
138 DCHECK(!in_print_job_); 138 DCHECK(!in_print_job_);
139 139
140 ResetSettings(); 140 ResetSettings();
141 settings_.set_dpi(kDefaultPdfDpi);
141 gfx::Size physical_size = GetPdfPaperSizeDeviceUnits(); 142 gfx::Size physical_size = GetPdfPaperSizeDeviceUnits();
142 SetSizes(&settings_, kDefaultPdfDpi, physical_size.width(), 143 SetSizes(&settings_, kDefaultPdfDpi, physical_size.width(),
143 physical_size.height()); 144 physical_size.height());
144 return OK; 145 return OK;
145 } 146 }
146 147
147 gfx::Size PrintingContextAndroid::GetPdfPaperSizeDeviceUnits() { 148 gfx::Size PrintingContextAndroid::GetPdfPaperSizeDeviceUnits() {
148 // NOTE: This implementation is the same as in PrintingContextNoSystemDialog. 149 // NOTE: This implementation is the same as in PrintingContextNoSystemDialog.
149 int32_t width = 0; 150 int32_t width = 0;
150 int32_t height = 0; 151 int32_t height = 0;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // Intentional No-op. 238 // Intentional No-op.
238 return NULL; 239 return NULL;
239 } 240 }
240 241
241 // static 242 // static
242 bool PrintingContextAndroid::RegisterPrintingContext(JNIEnv* env) { 243 bool PrintingContextAndroid::RegisterPrintingContext(JNIEnv* env) {
243 return RegisterNativesImpl(env); 244 return RegisterNativesImpl(env);
244 } 245 }
245 246
246 } // namespace printing 247 } // 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