| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WIN_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_WIN_H_ |
| 6 #define PRINTING_PRINTING_CONTEXT_WIN_H_ | 6 #define PRINTING_PRINTING_CONTEXT_WIN_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "printing/printing_context.h" | 12 #include "printing/printing_context.h" |
| 13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 14 | 14 |
| 15 namespace printing { | 15 namespace printing { |
| 16 | 16 |
| 17 class PrintSettings; | 17 class PrintSettings; |
| 18 | 18 |
| 19 class PRINTING_EXPORT PrintingContextWin : public PrintingContext { | 19 class PRINTING_EXPORT PrintingContextWin : public PrintingContext { |
| 20 public: | 20 public: |
| 21 explicit PrintingContextWin(Delegate* delegate); | 21 explicit PrintingContextWin(Delegate* delegate); |
| 22 ~PrintingContextWin() override; | 22 ~PrintingContextWin() override; |
| 23 | 23 |
| 24 // Initializes with predefined settings. |
| 25 Result InitWithSettingsForTest(const PrintSettings& settings); |
| 26 |
| 24 // PrintingContext implementation. | 27 // PrintingContext implementation. |
| 25 void AskUserForSettings( | 28 void AskUserForSettings( |
| 26 int max_pages, | 29 int max_pages, |
| 27 bool has_selection, | 30 bool has_selection, |
| 28 bool is_scripted, | 31 bool is_scripted, |
| 29 const PrintSettingsCallback& callback) override; | 32 const PrintSettingsCallback& callback) override; |
| 30 Result UseDefaultSettings() override; | 33 Result UseDefaultSettings() override; |
| 31 gfx::Size GetPdfPaperSizeDeviceUnits() override; | 34 gfx::Size GetPdfPaperSizeDeviceUnits() override; |
| 32 Result UpdatePrinterSettings(bool external_preview, | 35 Result UpdatePrinterSettings(bool external_preview, |
| 33 bool show_system_dialog, | 36 bool show_system_dialog, |
| 34 int page_count) override; | 37 int page_count) override; |
| 35 Result InitWithSettings(const PrintSettings& settings) override; | |
| 36 Result NewDocument(const base::string16& document_name) override; | 38 Result NewDocument(const base::string16& document_name) override; |
| 37 Result NewPage() override; | 39 Result NewPage() override; |
| 38 Result PageDone() override; | 40 Result PageDone() override; |
| 39 Result DocumentDone() override; | 41 Result DocumentDone() override; |
| 40 void Cancel() override; | 42 void Cancel() override; |
| 41 void ReleaseContext() override; | 43 void ReleaseContext() override; |
| 42 gfx::NativeDrawingContext context() const override; | 44 gfx::NativeDrawingContext context() const override; |
| 43 | 45 |
| 44 protected: | 46 protected: |
| 45 static HWND GetRootWindow(gfx::NativeView view); | 47 static HWND GetRootWindow(gfx::NativeView view); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 57 | 59 |
| 58 // The selected printer context. | 60 // The selected printer context. |
| 59 HDC context_; | 61 HDC context_; |
| 60 | 62 |
| 61 DISALLOW_COPY_AND_ASSIGN(PrintingContextWin); | 63 DISALLOW_COPY_AND_ASSIGN(PrintingContextWin); |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 } // namespace printing | 66 } // namespace printing |
| 65 | 67 |
| 66 #endif // PRINTING_PRINTING_CONTEXT_WIN_H_ | 68 #endif // PRINTING_PRINTING_CONTEXT_WIN_H_ |
| OLD | NEW |