| 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; | |
| 272 | 270 |
| 273 caps.duplex_capable = | 271 caps.duplex_capable = |
| 274 (DeviceCapabilities(name, port, DC_DUPLEX, NULL, NULL) == 1); | 272 (DeviceCapabilities(name, port, DC_DUPLEX, NULL, NULL) == 1); |
| 275 | 273 |
| 276 caps.collate_capable = | 274 caps.collate_capable = |
| 277 (DeviceCapabilities(name, port, DC_COLLATE, NULL, NULL) == 1); | 275 (DeviceCapabilities(name, port, DC_COLLATE, NULL, NULL) == 1); |
| 278 | 276 |
| 279 caps.copies_capable = | 277 caps.copies_capable = |
| 280 (DeviceCapabilities(name, port, DC_COPIES, NULL, NULL) > 1); | 278 (DeviceCapabilities(name, port, DC_COPIES, NULL, NULL) > 1); |
| 281 | 279 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 ScopedPrinterHandle printer_handle; | 361 ScopedPrinterHandle printer_handle; |
| 364 return printer_handle.OpenPrinter(base::UTF8ToWide(printer_name).c_str()); | 362 return printer_handle.OpenPrinter(base::UTF8ToWide(printer_name).c_str()); |
| 365 } | 363 } |
| 366 | 364 |
| 367 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( | 365 scoped_refptr<PrintBackend> PrintBackend::CreateInstance( |
| 368 const base::DictionaryValue* print_backend_settings) { | 366 const base::DictionaryValue* print_backend_settings) { |
| 369 return new PrintBackendWin; | 367 return new PrintBackendWin; |
| 370 } | 368 } |
| 371 | 369 |
| 372 } // namespace printing | 370 } // namespace printing |
| OLD | NEW |