Battery Status API: add UMA logging for Linux.
[chromium-blink-merge.git] / android_webview / native / aw_pdf_exporter.h
blobd27b092045ae40fc62151d687dcedf6079a61502
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 "android_webview/browser/renderer_host/print_manager.h"
11 #include "base/android/jni_weak_ref.h"
12 #include "base/android/scoped_java_ref.h"
13 #include "base/basictypes.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "skia/ext/refptr.h"
17 namespace content {
18 class WebContents;
21 namespace printing {
22 class PrintSettings;
25 namespace android_webview {
27 class AwPdfExporter : public PrintManagerDelegate {
28 public:
29 AwPdfExporter(JNIEnv* env,
30 jobject obj,
31 content::WebContents* web_contents);
33 virtual ~AwPdfExporter();
35 void ExportToPdf(JNIEnv* env,
36 jobject obj,
37 int fd,
38 jobject cancel_signal);
40 // Implement PrintManagerDelegate methods
41 virtual void DidExportPdf(bool success) OVERRIDE;
42 virtual bool IsCancelled() OVERRIDE;
44 private:
45 void CreatePdfSettings(JNIEnv* env, jobject obj);
47 JavaObjectWeakGlobalRef java_ref_;
48 content::WebContents* web_contents_;
50 scoped_ptr<PrintManager> print_manager_;
51 scoped_ptr<printing::PrintSettings> print_settings_;
53 DISALLOW_COPY_AND_ASSIGN(AwPdfExporter);
56 bool RegisterAwPdfExporter(JNIEnv* env);
58 } // namespace android_webview
60 #endif // ANDROID_WEBVIEW_NATIVE_AW_PDF_EXPORTER_H_