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

Side by Side Diff: printing/printing_context_android.h

Issue 740983002: Implement window.print() on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « printing/printing_context.h ('k') | printing/printing_context_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 PRINTING_PRINTING_CONTEXT_ANDROID_H_ 5 #ifndef PRINTING_PRINTING_CONTEXT_ANDROID_H_
6 #define PRINTING_PRINTING_CONTEXT_ANDROID_H_ 6 #define PRINTING_PRINTING_CONTEXT_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/android/scoped_java_ref.h" 12 #include "base/android/scoped_java_ref.h"
13 #include "printing/printing_context.h" 13 #include "printing/printing_context.h"
14 14
15 namespace printing { 15 namespace printing {
16 16
17 // Android subclass of PrintingContext. The implementation for this header file 17 // Android subclass of PrintingContext. This class communicates with the
18 // resides in Chrome for Android repository. This class communicates with the
19 // Java side through JNI. 18 // Java side through JNI.
20 class PRINTING_EXPORT PrintingContextAndroid : public PrintingContext { 19 class PRINTING_EXPORT PrintingContextAndroid : public PrintingContext {
21 public: 20 public:
22 explicit PrintingContextAndroid(Delegate* delegate); 21 explicit PrintingContextAndroid(Delegate* delegate);
23 virtual ~PrintingContextAndroid(); 22 virtual ~PrintingContextAndroid();
24 23
25 // Called when the page is successfully written to a PDF using the file 24 // Called when the page is successfully written to a PDF using the file
26 // descriptor specified, or when the printing operation failed. 25 // descriptor specified, or when the printing operation failed.
27 static void PdfWritingDone(int fd, bool success); 26 static void PdfWritingDone(int fd, bool success);
28 27
29 // Called from Java, when printing settings from the user are ready or the 28 // Called from Java, when printing settings from the user are ready or the
30 // printing operation is canceled. 29 // printing operation is canceled.
31 void AskUserForSettingsReply(JNIEnv* env, jobject obj, jboolean success); 30 void AskUserForSettingsReply(JNIEnv* env, jobject obj, jboolean success);
32 31
32 // Called from Java, when a printing process initiated by a script finishes.
33 void ShowSystemDialogDone(JNIEnv* env, jobject obj);
34
33 // PrintingContext implementation. 35 // PrintingContext implementation.
34 virtual void AskUserForSettings( 36 virtual void AskUserForSettings(
35 int max_pages, 37 int max_pages,
36 bool has_selection, 38 bool has_selection,
39 bool is_scripted,
37 const PrintSettingsCallback& callback) override; 40 const PrintSettingsCallback& callback) override;
38 virtual Result UseDefaultSettings() override; 41 virtual Result UseDefaultSettings() override;
39 virtual gfx::Size GetPdfPaperSizeDeviceUnits() override; 42 virtual gfx::Size GetPdfPaperSizeDeviceUnits() override;
40 virtual Result UpdatePrinterSettings(bool external_preview, 43 virtual Result UpdatePrinterSettings(bool external_preview,
41 bool show_system_dialog) override; 44 bool show_system_dialog) override;
42 virtual Result InitWithSettings(const PrintSettings& settings) override; 45 virtual Result InitWithSettings(const PrintSettings& settings) override;
43 virtual Result NewDocument(const base::string16& document_name) override; 46 virtual Result NewDocument(const base::string16& document_name) override;
44 virtual Result NewPage() override; 47 virtual Result NewPage() override;
45 virtual Result PageDone() override; 48 virtual Result PageDone() override;
46 virtual Result DocumentDone() override; 49 virtual Result DocumentDone() override;
(...skipping 11 matching lines...) Expand all
58 // ready on the Java side 61 // ready on the Java side
59 PrintSettingsCallback callback_; 62 PrintSettingsCallback callback_;
60 63
61 DISALLOW_COPY_AND_ASSIGN(PrintingContextAndroid); 64 DISALLOW_COPY_AND_ASSIGN(PrintingContextAndroid);
62 }; 65 };
63 66
64 } // namespace printing 67 } // namespace printing
65 68
66 #endif // PRINTING_PRINTING_CONTEXT_ANDROID_H_ 69 #endif // PRINTING_PRINTING_CONTEXT_ANDROID_H_
67 70
OLDNEW
« no previous file with comments | « printing/printing_context.h ('k') | printing/printing_context_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698