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

Side by Side Diff: android_webview/native/aw_pdf_exporter.h

Issue 2770713003: Enable page selection for WebView printing (Closed)
Patch Set: review fixes Created 3 years, 9 months 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
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 #ifndef ANDROID_WEBVIEW_NATIVE_AW_PDF_EXPORTER_H_ 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_PDF_EXPORTER_H_
6 #define ANDROID_WEBVIEW_NATIVE_AW_PDF_EXPORTER_H_ 6 #define ANDROID_WEBVIEW_NATIVE_AW_PDF_EXPORTER_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/jni_weak_ref.h" 10 #include "base/android/jni_weak_ref.h"
11 #include "base/android/scoped_java_ref.h" 11 #include "base/android/scoped_java_ref.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 13
14 #include "printing/page_range.h"
15
14 namespace content { 16 namespace content {
15 class WebContents; 17 class WebContents;
16 }; 18 };
17 19
18 namespace printing { 20 namespace printing {
19 class PrintSettings; 21 class PrintSettings;
20 }; 22 };
21 23
22 namespace android_webview { 24 namespace android_webview {
23 25
24 class AwPdfExporter { 26 class AwPdfExporter {
25 public: 27 public:
26 AwPdfExporter(JNIEnv* env, 28 AwPdfExporter(JNIEnv* env,
27 const base::android::JavaRef<jobject>& obj, 29 const base::android::JavaRef<jobject>& obj,
28 content::WebContents* web_contents); 30 content::WebContents* web_contents);
29 31
30 ~AwPdfExporter(); 32 ~AwPdfExporter();
31 33
32 void ExportToPdf(JNIEnv* env, 34 void ExportToPdf(JNIEnv* env,
33 const base::android::JavaParamRef<jobject>& obj, 35 const base::android::JavaParamRef<jobject>& obj,
34 int fd, 36 int fd,
37 jintArray pages,
35 const base::android::JavaParamRef<jobject>& cancel_signal); 38 const base::android::JavaParamRef<jobject>& cancel_signal);
36 39
37 private: 40 private:
38 void InitPdfSettings(JNIEnv* env, 41 void InitPdfSettings(JNIEnv* env,
39 const base::android::JavaRef<jobject>& obj, 42 const base::android::JavaRef<jobject>& obj,
43 const printing::PageRanges& page_ranges,
40 printing::PrintSettings& settings); 44 printing::PrintSettings& settings);
41 void DidExportPdf(int fd, bool success); 45 void DidExportPdf(int fd, bool success);
42 46
43 JavaObjectWeakGlobalRef java_ref_; 47 JavaObjectWeakGlobalRef java_ref_;
44 content::WebContents* web_contents_; 48 content::WebContents* web_contents_;
45 49
46 DISALLOW_COPY_AND_ASSIGN(AwPdfExporter); 50 DISALLOW_COPY_AND_ASSIGN(AwPdfExporter);
47 }; 51 };
48 52
49 bool RegisterAwPdfExporter(JNIEnv* env); 53 bool RegisterAwPdfExporter(JNIEnv* env);
50 54
51 } // namespace android_webview 55 } // namespace android_webview
52 56
53 #endif // ANDROID_WEBVIEW_NATIVE_AW_PDF_EXPORTER_H_ 57 #endif // ANDROID_WEBVIEW_NATIVE_AW_PDF_EXPORTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698