Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(972)

Side by Side Diff: printing/backend/win_helper.cc

Issue 605563002: Remove implicit HANDLE conversions from printing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « printing/backend/print_backend_win.cc ('k') | printing/emf_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/win_helper.h" 5 #include "printing/backend/win_helper.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 hr = printing::XPSModule::ConvertPrintTicketToDevMode(provider, 413 hr = printing::XPSModule::ConvertPrintTicketToDevMode(provider,
414 pt_stream, 414 pt_stream,
415 kUserDefaultDevmode, 415 kUserDefaultDevmode,
416 kPTJobScope, 416 kPTJobScope,
417 &size, 417 &size,
418 &dm, 418 &dm,
419 NULL); 419 NULL);
420 if (SUCCEEDED(hr)) { 420 if (SUCCEEDED(hr)) {
421 // Correct DEVMODE using DocumentProperties. See documentation for 421 // Correct DEVMODE using DocumentProperties. See documentation for
422 // PTConvertPrintTicketToDevMode. 422 // PTConvertPrintTicketToDevMode.
423 dev_mode = CreateDevMode(printer, dm); 423 dev_mode = CreateDevMode(printer.Get(), dm);
424 printing::XPSModule::ReleaseMemory(dm); 424 printing::XPSModule::ReleaseMemory(dm);
425 } 425 }
426 printing::XPSModule::CloseProvider(provider); 426 printing::XPSModule::CloseProvider(provider);
427 } 427 }
428 return dev_mode.Pass(); 428 return dev_mode.Pass();
429 } 429 }
430 430
431 scoped_ptr<DEVMODE, base::FreeDeleter> CreateDevModeWithColor( 431 scoped_ptr<DEVMODE, base::FreeDeleter> CreateDevModeWithColor(
432 HANDLE printer, 432 HANDLE printer,
433 const base::string16& printer_name, 433 const base::string16& printer_name,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 flags); 514 flags);
515 if (canceled) 515 if (canceled)
516 *canceled = (result == IDCANCEL); 516 *canceled = (result == IDCANCEL);
517 if (result != IDOK) 517 if (result != IDOK)
518 return scoped_ptr<DEVMODE, base::FreeDeleter>(); 518 return scoped_ptr<DEVMODE, base::FreeDeleter>();
519 CHECK_GE(buffer_size, out.get()->dmSize + out.get()->dmDriverExtra); 519 CHECK_GE(buffer_size, out.get()->dmSize + out.get()->dmDriverExtra);
520 return out.Pass(); 520 return out.Pass();
521 } 521 }
522 522
523 } // namespace printing 523 } // namespace printing
OLDNEW
« no previous file with comments | « printing/backend/print_backend_win.cc ('k') | printing/emf_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698