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 #include "printing/backend/print_backend.h" | 5 #include "printing/backend/print_backend.h" |
6 | 6 |
7 #include <objidl.h> | 7 #include <objidl.h> |
8 #include <winspool.h> | 8 #include <winspool.h> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 } // namespace | 153 } // namespace |
154 | 154 |
155 class PrintBackendWin : public PrintBackend { | 155 class PrintBackendWin : public PrintBackend { |
156 public: | 156 public: |
157 PrintBackendWin() {} | 157 PrintBackendWin() {} |
158 | 158 |
159 // PrintBackend implementation. | 159 // PrintBackend implementation. |
160 virtual bool EnumeratePrinters(PrinterList* printer_list) OVERRIDE; | 160 virtual bool EnumeratePrinters(PrinterList* printer_list) override; |
161 virtual std::string GetDefaultPrinterName() OVERRIDE; | 161 virtual std::string GetDefaultPrinterName() override; |
162 virtual bool GetPrinterSemanticCapsAndDefaults( | 162 virtual bool GetPrinterSemanticCapsAndDefaults( |
163 const std::string& printer_name, | 163 const std::string& printer_name, |
164 PrinterSemanticCapsAndDefaults* printer_info) OVERRIDE; | 164 PrinterSemanticCapsAndDefaults* printer_info) override; |
165 virtual bool GetPrinterCapsAndDefaults( | 165 virtual bool GetPrinterCapsAndDefaults( |
166 const std::string& printer_name, | 166 const std::string& printer_name, |
167 PrinterCapsAndDefaults* printer_info) OVERRIDE; | 167 PrinterCapsAndDefaults* printer_info) override; |
168 virtual std::string GetPrinterDriverInfo( | 168 virtual std::string GetPrinterDriverInfo( |
169 const std::string& printer_name) OVERRIDE; | 169 const std::string& printer_name) override; |
170 virtual bool IsValidPrinter(const std::string& printer_name) OVERRIDE; | 170 virtual bool IsValidPrinter(const std::string& printer_name) override; |
171 | 171 |
172 protected: | 172 protected: |
173 virtual ~PrintBackendWin() {} | 173 virtual ~PrintBackendWin() {} |
174 }; | 174 }; |
175 | 175 |
176 bool PrintBackendWin::EnumeratePrinters(PrinterList* printer_list) { | 176 bool PrintBackendWin::EnumeratePrinters(PrinterList* printer_list) { |
177 DCHECK(printer_list); | 177 DCHECK(printer_list); |
178 DWORD bytes_needed = 0; | 178 DWORD bytes_needed = 0; |
179 DWORD count_returned = 0; | 179 DWORD count_returned = 0; |
180 const DWORD kLevel = 4; | 180 const DWORD kLevel = 4; |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 ScopedPrinterHandle printer_handle; | 361 ScopedPrinterHandle printer_handle; |
362 return printer_handle.OpenPrinter(base::UTF8ToWide(printer_name).c_str()); | 362 return printer_handle.OpenPrinter(base::UTF8ToWide(printer_name).c_str()); |
363 } | 363 } |
364 | 364 |
365 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( | 365 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( |
366 const base::DictionaryValue* print_backend_settings) { | 366 const base::DictionaryValue* print_backend_settings) { |
367 return new PrintBackendWin; | 367 return new PrintBackendWin; |
368 } | 368 } |
369 | 369 |
370 } // namespace printing | 370 } // namespace printing |
OLD | NEW |