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 |
(...skipping 23 matching lines...) Expand all Loading... | |
34 gfx::Size GetPdfPaperSizeDeviceUnits() override; | 34 gfx::Size GetPdfPaperSizeDeviceUnits() override; |
35 Result UpdatePrinterSettings(bool external_preview, | 35 Result UpdatePrinterSettings(bool external_preview, |
36 bool show_system_dialog, | 36 bool show_system_dialog, |
37 int page_count) override; | 37 int page_count) override; |
38 Result NewDocument(const base::string16& document_name) override; | 38 Result NewDocument(const base::string16& document_name) override; |
39 Result NewPage() override; | 39 Result NewPage() override; |
40 Result PageDone() override; | 40 Result PageDone() override; |
41 Result DocumentDone() override; | 41 Result DocumentDone() override; |
42 void Cancel() override; | 42 void Cancel() override; |
43 void ReleaseContext() override; | 43 void ReleaseContext() override; |
44 void SetPostScriptEnabled(bool is_enabled) override; | |
44 skia::NativeDrawingContext context() const override; | 45 skia::NativeDrawingContext context() const override; |
45 | 46 |
46 protected: | 47 protected: |
47 static HWND GetRootWindow(gfx::NativeView view); | 48 static HWND GetRootWindow(gfx::NativeView view); |
48 | 49 |
49 // Reads the settings from the selected device context. Updates settings_ and | 50 // Reads the settings from the selected device context. Updates settings_ and |
50 // its margins. | 51 // its margins. |
51 virtual Result InitializeSettings(const base::string16& device_name, | 52 virtual Result InitializeSettings(const base::string16& device_name, |
52 DEVMODE* dev_mode); | 53 DEVMODE* dev_mode); |
53 | 54 |
54 void set_context(HDC context) { context_ = context; } | 55 void set_context(HDC context) { context_ = context; } |
55 | 56 |
57 bool postscript_enabled() { return is_postscript_enabled_; } | |
Lei Zhang
2017/02/25 03:03:35
const method
| |
58 | |
56 private: | 59 private: |
57 // Used in response to the user canceling the printing. | 60 // Used in response to the user canceling the printing. |
58 static BOOL CALLBACK AbortProc(HDC hdc, int nCode); | 61 static BOOL CALLBACK AbortProc(HDC hdc, int nCode); |
59 | 62 |
60 // The selected printer context. | 63 // The selected printer context. |
61 HDC context_; | 64 HDC context_; |
62 | 65 |
66 // Is postscript printing enabled | |
Lei Zhang
2017/02/25 03:03:35
"Is the postscript printing feature enabled"
| |
67 bool is_postscript_enabled_ = false; | |
68 | |
63 DISALLOW_COPY_AND_ASSIGN(PrintingContextWin); | 69 DISALLOW_COPY_AND_ASSIGN(PrintingContextWin); |
64 }; | 70 }; |
65 | 71 |
66 } // namespace printing | 72 } // namespace printing |
67 | 73 |
68 #endif // PRINTING_PRINTING_CONTEXT_WIN_H_ | 74 #endif // PRINTING_PRINTING_CONTEXT_WIN_H_ |
OLD | NEW |