| 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 <ocidl.h> | 8 #include <ocidl.h> |
| 9 #include <commdlg.h> | 9 #include <commdlg.h> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 void SetPrintDialog(HRESULT (__stdcall *print_dialog_func)(LPPRINTDLGEX)) { | 46 void SetPrintDialog(HRESULT (__stdcall *print_dialog_func)(LPPRINTDLGEX)) { |
| 47 print_dialog_func_ = print_dialog_func; | 47 print_dialog_func_ = print_dialog_func; |
| 48 } | 48 } |
| 49 #endif // defined(UNIT_TEST) | 49 #endif // defined(UNIT_TEST) |
| 50 | 50 |
| 51 // Allocates the HDC for a specific DEVMODE. | 51 // Allocates the HDC for a specific DEVMODE. |
| 52 static bool AllocateContext(const std::wstring& printer_name, | 52 static bool AllocateContext(const std::wstring& printer_name, |
| 53 const DEVMODE* dev_mode, | 53 const DEVMODE* dev_mode, |
| 54 gfx::NativeDrawingContext* context); | 54 gfx::NativeDrawingContext* context); |
| 55 | 55 |
| 56 // Retrieves the content of a GetPrinter call. | |
| 57 static void GetPrinterHelper(HANDLE printer, int level, | |
| 58 scoped_array<uint8>* buffer); | |
| 59 | |
| 60 private: | 56 private: |
| 61 // Class that manages the PrintDlgEx() callbacks. This is meant to be a | 57 // Class that manages the PrintDlgEx() callbacks. This is meant to be a |
| 62 // temporary object used during the Print... dialog display. | 58 // temporary object used during the Print... dialog display. |
| 63 class CallbackHandler; | 59 class CallbackHandler; |
| 64 | 60 |
| 65 // Used in response to the user canceling the printing. | 61 // Used in response to the user canceling the printing. |
| 66 static BOOL CALLBACK AbortProc(HDC hdc, int nCode); | 62 static BOOL CALLBACK AbortProc(HDC hdc, int nCode); |
| 67 | 63 |
| 68 // Reads the settings from the selected device context. Updates settings_ and | 64 // Reads the settings from the selected device context. Updates settings_ and |
| 69 // its margins. | 65 // its margins. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 91 // Function pointer that defaults to PrintDlgEx. It can be changed using | 87 // Function pointer that defaults to PrintDlgEx. It can be changed using |
| 92 // SetPrintDialog() in tests. | 88 // SetPrintDialog() in tests. |
| 93 HRESULT (__stdcall *print_dialog_func_)(LPPRINTDLGEX); | 89 HRESULT (__stdcall *print_dialog_func_)(LPPRINTDLGEX); |
| 94 | 90 |
| 95 DISALLOW_COPY_AND_ASSIGN(PrintingContextWin); | 91 DISALLOW_COPY_AND_ASSIGN(PrintingContextWin); |
| 96 }; | 92 }; |
| 97 | 93 |
| 98 } // namespace printing | 94 } // namespace printing |
| 99 | 95 |
| 100 #endif // PRINTING_PRINTING_CONTEXT_WIN_H_ | 96 #endif // PRINTING_PRINTING_CONTEXT_WIN_H_ |
| OLD | NEW |