| 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 #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> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 void ShowSystemDialogDone(JNIEnv* env, jobject obj); | 33 void ShowSystemDialogDone(JNIEnv* env, jobject obj); |
| 34 | 34 |
| 35 // PrintingContext implementation. | 35 // PrintingContext implementation. |
| 36 void AskUserForSettings(int max_pages, | 36 void AskUserForSettings(int max_pages, |
| 37 bool has_selection, | 37 bool has_selection, |
| 38 bool is_scripted, | 38 bool is_scripted, |
| 39 const PrintSettingsCallback& callback) override; | 39 const PrintSettingsCallback& callback) override; |
| 40 Result UseDefaultSettings() override; | 40 Result UseDefaultSettings() override; |
| 41 gfx::Size GetPdfPaperSizeDeviceUnits() override; | 41 gfx::Size GetPdfPaperSizeDeviceUnits() override; |
| 42 Result UpdatePrinterSettings(bool external_preview, | 42 Result UpdatePrinterSettings(bool external_preview, |
| 43 bool show_system_dialog) override; | 43 bool show_system_dialog, |
| 44 int page_count) override; |
| 44 Result InitWithSettings(const PrintSettings& settings) override; | 45 Result InitWithSettings(const PrintSettings& settings) override; |
| 45 Result NewDocument(const base::string16& document_name) override; | 46 Result NewDocument(const base::string16& document_name) override; |
| 46 Result NewPage() override; | 47 Result NewPage() override; |
| 47 Result PageDone() override; | 48 Result PageDone() override; |
| 48 Result DocumentDone() override; | 49 Result DocumentDone() override; |
| 49 void Cancel() override; | 50 void Cancel() override; |
| 50 void ReleaseContext() override; | 51 void ReleaseContext() override; |
| 51 gfx::NativeDrawingContext context() const override; | 52 gfx::NativeDrawingContext context() const override; |
| 52 | 53 |
| 53 // Registers JNI bindings for RegisterContext. | 54 // Registers JNI bindings for RegisterContext. |
| 54 static bool RegisterPrintingContext(JNIEnv* env); | 55 static bool RegisterPrintingContext(JNIEnv* env); |
| 55 | 56 |
| 56 private: | 57 private: |
| 57 base::android::ScopedJavaGlobalRef<jobject> j_printing_context_; | 58 base::android::ScopedJavaGlobalRef<jobject> j_printing_context_; |
| 58 | 59 |
| 59 // The callback from AskUserForSettings to be called when the settings are | 60 // The callback from AskUserForSettings to be called when the settings are |
| 60 // ready on the Java side | 61 // ready on the Java side |
| 61 PrintSettingsCallback callback_; | 62 PrintSettingsCallback callback_; |
| 62 | 63 |
| 63 DISALLOW_COPY_AND_ASSIGN(PrintingContextAndroid); | 64 DISALLOW_COPY_AND_ASSIGN(PrintingContextAndroid); |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 } // namespace printing | 67 } // namespace printing |
| 67 | 68 |
| 68 #endif // PRINTING_PRINTING_CONTEXT_ANDROID_H_ | 69 #endif // PRINTING_PRINTING_CONTEXT_ANDROID_H_ |
| 69 | 70 |
| OLD | NEW |