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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 } else { | 260 } else { |
261 LOG(WARNING) << "Fallback to color/simplex mode."; | 261 LOG(WARNING) << "Fallback to color/simplex mode."; |
262 caps.color_default = caps.color_changeable; | 262 caps.color_default = caps.color_changeable; |
263 caps.duplex_default = SIMPLEX; | 263 caps.duplex_default = SIMPLEX; |
264 } | 264 } |
265 | 265 |
266 // Get printer capabilities. For more info see here: | 266 // Get printer capabilities. For more info see here: |
267 // http://msdn.microsoft.com/en-us/library/windows/desktop/dd183552(v=vs.85).a
spx | 267 // http://msdn.microsoft.com/en-us/library/windows/desktop/dd183552(v=vs.85).a
spx |
268 caps.color_changeable = | 268 caps.color_changeable = |
269 (DeviceCapabilities(name, port, DC_COLORDEVICE, NULL, NULL) == 1); | 269 (DeviceCapabilities(name, port, DC_COLORDEVICE, NULL, NULL) == 1); |
| 270 caps.color_model = printing::COLOR; |
| 271 caps.bw_model = printing::GRAY; |
270 | 272 |
271 caps.duplex_capable = | 273 caps.duplex_capable = |
272 (DeviceCapabilities(name, port, DC_DUPLEX, NULL, NULL) == 1); | 274 (DeviceCapabilities(name, port, DC_DUPLEX, NULL, NULL) == 1); |
273 | 275 |
274 caps.collate_capable = | 276 caps.collate_capable = |
275 (DeviceCapabilities(name, port, DC_COLLATE, NULL, NULL) == 1); | 277 (DeviceCapabilities(name, port, DC_COLLATE, NULL, NULL) == 1); |
276 | 278 |
277 caps.copies_capable = | 279 caps.copies_capable = |
278 (DeviceCapabilities(name, port, DC_COPIES, NULL, NULL) > 1); | 280 (DeviceCapabilities(name, port, DC_COPIES, NULL, NULL) > 1); |
279 | 281 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 ScopedPrinterHandle printer_handle; | 363 ScopedPrinterHandle printer_handle; |
362 return printer_handle.OpenPrinter(base::UTF8ToWide(printer_name).c_str()); | 364 return printer_handle.OpenPrinter(base::UTF8ToWide(printer_name).c_str()); |
363 } | 365 } |
364 | 366 |
365 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( | 367 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( |
366 const base::DictionaryValue* print_backend_settings) { | 368 const base::DictionaryValue* print_backend_settings) { |
367 return new PrintBackendWin; | 369 return new PrintBackendWin; |
368 } | 370 } |
369 | 371 |
370 } // namespace printing | 372 } // namespace printing |
OLD | NEW |