| 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/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 16 #include "base/values.h" | 17 #include "base/values.h" |
| 17 #include "jni/PrintingContext_jni.h" | 18 #include "jni/PrintingContext_jni.h" |
| 18 #include "printing/metafile.h" | 19 #include "printing/metafile.h" |
| 19 #include "printing/print_job_constants.h" | 20 #include "printing/print_job_constants.h" |
| 20 #include "printing/units.h" | 21 #include "printing/units.h" |
| 21 #include "third_party/icu/source/i18n/unicode/ulocdata.h" | 22 #include "third_party/icu/source/i18n/unicode/ulocdata.h" |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 range.to = *it; | 57 range.to = *it; |
| 57 range_vector.push_back(range); | 58 range_vector.push_back(range); |
| 58 } | 59 } |
| 59 } | 60 } |
| 60 | 61 |
| 61 } // namespace | 62 } // namespace |
| 62 | 63 |
| 63 namespace printing { | 64 namespace printing { |
| 64 | 65 |
| 65 // static | 66 // static |
| 66 scoped_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) { | 67 std::unique_ptr<PrintingContext> PrintingContext::Create(Delegate* delegate) { |
| 67 return make_scoped_ptr<PrintingContext>(new PrintingContextAndroid(delegate)); | 68 return base::WrapUnique(new PrintingContextAndroid(delegate)); |
| 68 } | 69 } |
| 69 | 70 |
| 70 // static | 71 // static |
| 71 void PrintingContextAndroid::PdfWritingDone(int fd, bool success) { | 72 void PrintingContextAndroid::PdfWritingDone(int fd, bool success) { |
| 72 JNIEnv* env = base::android::AttachCurrentThread(); | 73 JNIEnv* env = base::android::AttachCurrentThread(); |
| 73 Java_PrintingContext_pdfWritingDone(env, fd, success); | 74 Java_PrintingContext_pdfWritingDone(env, fd, success); |
| 74 } | 75 } |
| 75 | 76 |
| 76 PrintingContextAndroid::PrintingContextAndroid(Delegate* delegate) | 77 PrintingContextAndroid::PrintingContextAndroid(Delegate* delegate) |
| 77 : PrintingContext(delegate) { | 78 : PrintingContext(delegate) { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // Intentional No-op. | 256 // Intentional No-op. |
| 256 return NULL; | 257 return NULL; |
| 257 } | 258 } |
| 258 | 259 |
| 259 // static | 260 // static |
| 260 bool PrintingContextAndroid::RegisterPrintingContext(JNIEnv* env) { | 261 bool PrintingContextAndroid::RegisterPrintingContext(JNIEnv* env) { |
| 261 return RegisterNativesImpl(env); | 262 return RegisterNativesImpl(env); |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // namespace printing | 265 } // namespace printing |
| OLD | NEW |