| 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 gfx::NativeDrawingContext context() const override; | 44 skia::NativeDrawingContext context() const override; |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 static HWND GetRootWindow(gfx::NativeView view); | 47 static HWND GetRootWindow(gfx::NativeView view); |
| 48 | 48 |
| 49 // Reads the settings from the selected device context. Updates settings_ and | 49 // Reads the settings from the selected device context. Updates settings_ and |
| 50 // its margins. | 50 // its margins. |
| 51 virtual Result InitializeSettings(const base::string16& device_name, | 51 virtual Result InitializeSettings(const base::string16& device_name, |
| 52 DEVMODE* dev_mode); | 52 DEVMODE* dev_mode); |
| 53 | 53 |
| 54 void set_context(HDC context) { context_ = context; } | 54 void set_context(HDC context) { context_ = context; } |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 // Used in response to the user canceling the printing. | 57 // Used in response to the user canceling the printing. |
| 58 static BOOL CALLBACK AbortProc(HDC hdc, int nCode); | 58 static BOOL CALLBACK AbortProc(HDC hdc, int nCode); |
| 59 | 59 |
| 60 // The selected printer context. | 60 // The selected printer context. |
| 61 HDC context_; | 61 HDC context_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(PrintingContextWin); | 63 DISALLOW_COPY_AND_ASSIGN(PrintingContextWin); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace printing | 66 } // namespace printing |
| 67 | 67 |
| 68 #endif // PRINTING_PRINTING_CONTEXT_WIN_H_ | 68 #endif // PRINTING_PRINTING_CONTEXT_WIN_H_ |
| OLD | NEW |