OLD | NEW |
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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/android/jni_android.h" | 11 #include "base/android/jni_android.h" |
12 #include "base/android/jni_array.h" | 12 #include "base/android/jni_array.h" |
13 #include "base/android/jni_string.h" | 13 #include "base/android/jni_string.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "jni/PrintingContext_jni.h" | 18 #include "jni/PrintingContext_jni.h" |
19 #include "printing/metafile.h" | 19 #include "printing/metafile.h" |
20 #include "printing/print_job_constants.h" | 20 #include "printing/print_job_constants.h" |
21 #include "printing/units.h" | 21 #include "printing/units.h" |
22 #include "third_party/icu/source/i18n/unicode/ulocdata.h" | 22 #include "third_party/icu/source/i18n/unicode/ulocdata.h" |
23 | 23 |
| 24 using base::android::JavaParamRef; |
| 25 using base::android::ScopedJavaLocalRef; |
| 26 |
24 namespace { | 27 namespace { |
25 | 28 |
26 // 1 inch in mils. | 29 // 1 inch in mils. |
27 const int kInchToMil = 1000; | 30 const int kInchToMil = 1000; |
28 | 31 |
29 inline int Round(double x) { | 32 inline int Round(double x) { |
30 return static_cast<int>(x + 0.5); | 33 return static_cast<int>(x + 0.5); |
31 } | 34 } |
32 | 35 |
33 // Sets the page sizes for a |PrintSettings| object. |width| and |height| | 36 // Sets the page sizes for a |PrintSettings| object. |width| and |height| |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // Intentional No-op. | 259 // Intentional No-op. |
257 return NULL; | 260 return NULL; |
258 } | 261 } |
259 | 262 |
260 // static | 263 // static |
261 bool PrintingContextAndroid::RegisterPrintingContext(JNIEnv* env) { | 264 bool PrintingContextAndroid::RegisterPrintingContext(JNIEnv* env) { |
262 return RegisterNativesImpl(env); | 265 return RegisterNativesImpl(env); |
263 } | 266 } |
264 | 267 |
265 } // namespace printing | 268 } // namespace printing |
OLD | NEW |