Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / android_webview / native / aw_pdf_exporter.h
blobd9f3a6b01dbea07684199db92f96481c00740aaf
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
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_PDF_EXPORTER_H_
6 #define ANDROID_WEBVIEW_NATIVE_AW_PDF_EXPORTER_H_
8 #include <jni.h>
10 #include "base/android/jni_weak_ref.h"
11 #include "base/android/scoped_java_ref.h"
12 #include "base/basictypes.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "skia/ext/refptr.h"
16 namespace content {
17 class WebContents;
20 namespace printing {
21 class PrintSettings;
24 namespace android_webview {
26 class AwPdfExporter {
27 public:
28 AwPdfExporter(JNIEnv* env,
29 jobject obj,
30 content::WebContents* web_contents);
32 ~AwPdfExporter();
34 void ExportToPdf(JNIEnv* env,
35 jobject obj,
36 int fd,
37 jobject cancel_signal);
39 private:
40 void CreatePdfSettings(JNIEnv* env, jobject obj);
41 void DidExportPdf(int fd, bool success);
43 JavaObjectWeakGlobalRef java_ref_;
44 content::WebContents* web_contents_;
46 scoped_ptr<printing::PrintSettings> print_settings_;
48 DISALLOW_COPY_AND_ASSIGN(AwPdfExporter);
51 bool RegisterAwPdfExporter(JNIEnv* env);
53 } // namespace android_webview
55 #endif // ANDROID_WEBVIEW_NATIVE_AW_PDF_EXPORTER_H_