| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BACKEND_WIN_HELPER_H_ | 5 #ifndef PRINTING_BACKEND_WIN_HELPER_H_ |
| 6 #define PRINTING_BACKEND_WIN_HELPER_H_ | 6 #define PRINTING_BACKEND_WIN_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <objidl.h> | 9 #include <objidl.h> |
| 10 #include <winspool.h> | 10 #include <winspool.h> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 typedef HANDLE Handle; | 23 typedef HANDLE Handle; |
| 24 | 24 |
| 25 static bool CloseHandle(HANDLE handle) { | 25 static bool CloseHandle(HANDLE handle) { |
| 26 return ::ClosePrinter(handle) != FALSE; | 26 return ::ClosePrinter(handle) != FALSE; |
| 27 } | 27 } |
| 28 | 28 |
| 29 static bool IsHandleValid(HANDLE handle) { | 29 static bool IsHandleValid(HANDLE handle) { |
| 30 return handle != NULL; | 30 return handle != NULL; |
| 31 } | 31 } |
| 32 | 32 |
| 33 static bool IsSame(HANDLE lhs, HANDLE rhs) { |
| 34 return lhs == rhs; |
| 35 } |
| 36 |
| 33 static HANDLE NullHandle() { | 37 static HANDLE NullHandle() { |
| 34 return NULL; | 38 return NULL; |
| 35 } | 39 } |
| 36 | 40 |
| 37 private: | 41 private: |
| 38 DISALLOW_IMPLICIT_CONSTRUCTORS(PrinterHandleTraits); | 42 DISALLOW_IMPLICIT_CONSTRUCTORS(PrinterHandleTraits); |
| 39 }; | 43 }; |
| 40 | 44 |
| 41 typedef base::win::GenericScopedHandle<PrinterHandleTraits> ScopedPrinterHandle; | 45 typedef base::win::GenericScopedHandle<PrinterHandleTraits> ScopedPrinterHandle; |
| 42 | 46 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 IXpsPrintJobStream **document_stream, | 120 IXpsPrintJobStream **document_stream, |
| 117 IXpsPrintJobStream **print_ticket_stream); | 121 IXpsPrintJobStream **print_ticket_stream); |
| 118 private: | 122 private: |
| 119 XPSPrintModule() { } | 123 XPSPrintModule() { } |
| 120 static bool InitImpl(); | 124 static bool InitImpl(); |
| 121 }; | 125 }; |
| 122 | 126 |
| 123 } // namespace printing | 127 } // namespace printing |
| 124 | 128 |
| 125 #endif // PRINTING_BACKEND_WIN_HELPER_H_ | 129 #endif // PRINTING_BACKEND_WIN_HELPER_H_ |
| OLD | NEW |