| 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 "android_webview/native/aw_pdf_exporter.h" | 5 #include "android_webview/native/aw_pdf_exporter.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_print_manager.h" | 7 #include "android_webview/browser/aw_print_manager.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "jni/AwPdfExporter_jni.h" | 10 #include "jni/AwPdfExporter_jni.h" |
| 11 #include "printing/print_settings.h" | 11 #include "printing/print_settings.h" |
| 12 #include "printing/units.h" | 12 #include "printing/units.h" |
| 13 | 13 |
| 14 using base::android::JavaParamRef; |
| 15 using base::android::ScopedJavaLocalRef; |
| 16 |
| 14 namespace android_webview { | 17 namespace android_webview { |
| 15 | 18 |
| 16 AwPdfExporter::AwPdfExporter(JNIEnv* env, | 19 AwPdfExporter::AwPdfExporter(JNIEnv* env, |
| 17 jobject obj, | 20 jobject obj, |
| 18 content::WebContents* web_contents) | 21 content::WebContents* web_contents) |
| 19 : java_ref_(env, obj), | 22 : java_ref_(env, obj), |
| 20 web_contents_(web_contents) { | 23 web_contents_(web_contents) { |
| 21 DCHECK(obj); | 24 DCHECK(obj); |
| 22 Java_AwPdfExporter_setNativeAwPdfExporter( | 25 Java_AwPdfExporter_setNativeAwPdfExporter( |
| 23 env, obj, reinterpret_cast<intptr_t>(this)); | 26 env, obj, reinterpret_cast<intptr_t>(this)); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (obj.is_null()) | 99 if (obj.is_null()) |
| 97 return; | 100 return; |
| 98 Java_AwPdfExporter_didExportPdf(env, obj.obj(), success); | 101 Java_AwPdfExporter_didExportPdf(env, obj.obj(), success); |
| 99 } | 102 } |
| 100 | 103 |
| 101 bool RegisterAwPdfExporter(JNIEnv* env) { | 104 bool RegisterAwPdfExporter(JNIEnv* env) { |
| 102 return RegisterNativesImpl(env); | 105 return RegisterNativesImpl(env); |
| 103 } | 106 } |
| 104 | 107 |
| 105 } // namespace android_webview | 108 } // namespace android_webview |
| OLD | NEW |