OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/printing/win_printing_context.h" | 5 #include "chrome/browser/printing/win_printing_context.h" |
6 | 6 |
7 #include <winspool.h> | 7 #include <winspool.h> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/time_format.h" | 10 #include "base/time_format.h" |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 // leverage PrintJobManager here? | 370 // leverage PrintJobManager here? |
371 // abort_printing_ = true; | 371 // abort_printing_ = true; |
372 } | 372 } |
373 return true; | 373 return true; |
374 } | 374 } |
375 | 375 |
376 bool PrintingContext::InitializeSettings(const DEVMODE& dev_mode, | 376 bool PrintingContext::InitializeSettings(const DEVMODE& dev_mode, |
377 const std::wstring& new_device_name, | 377 const std::wstring& new_device_name, |
378 const PRINTPAGERANGE* ranges, | 378 const PRINTPAGERANGE* ranges, |
379 int number_ranges) { | 379 int number_ranges) { |
380 gfx::PlatformDeviceWin::InitializeDC(hdc_); | 380 skia::PlatformDeviceWin::InitializeDC(hdc_); |
381 DCHECK(GetDeviceCaps(hdc_, CLIPCAPS)); | 381 DCHECK(GetDeviceCaps(hdc_, CLIPCAPS)); |
382 DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_STRETCHDIB); | 382 DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_STRETCHDIB); |
383 DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_BITMAP64); | 383 DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_BITMAP64); |
384 // Some printers don't advertise these. | 384 // Some printers don't advertise these. |
385 // DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_SCALING); | 385 // DCHECK(GetDeviceCaps(hdc_, RASTERCAPS) & RC_SCALING); |
386 // DCHECK(GetDeviceCaps(hdc_, SHADEBLENDCAPS) & SB_CONST_ALPHA); | 386 // DCHECK(GetDeviceCaps(hdc_, SHADEBLENDCAPS) & SB_CONST_ALPHA); |
387 // DCHECK(GetDeviceCaps(hdc_, SHADEBLENDCAPS) & SB_PIXEL_ALPHA); | 387 // DCHECK(GetDeviceCaps(hdc_, SHADEBLENDCAPS) & SB_PIXEL_ALPHA); |
388 | 388 |
389 // StretchDIBits() support is needed for printing. | 389 // StretchDIBits() support is needed for printing. |
390 if (!(GetDeviceCaps(hdc_, RASTERCAPS) & RC_STRETCHDIB) || | 390 if (!(GetDeviceCaps(hdc_, RASTERCAPS) & RC_STRETCHDIB) || |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 if (dialog_options.hDevMode != NULL) | 595 if (dialog_options.hDevMode != NULL) |
596 GlobalFree(dialog_options.hDevMode); | 596 GlobalFree(dialog_options.hDevMode); |
597 if (dialog_options.hDevNames != NULL) | 597 if (dialog_options.hDevNames != NULL) |
598 GlobalFree(dialog_options.hDevNames); | 598 GlobalFree(dialog_options.hDevNames); |
599 | 599 |
600 return hdc_ ? OK : FAILED; | 600 return hdc_ ? OK : FAILED; |
601 } | 601 } |
602 | 602 |
603 } // namespace printing | 603 } // namespace printing |
604 | 604 |
OLD | NEW |