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

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

Issue 2824773002: Rename ScopedComPtr::get() to ScopedComPtr::Get() (Closed)
Patch Set: Update to 5293966 Created 3 years, 8 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') | remoting/host/audio_capturer_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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 if (FAILED(hr)) 409 if (FAILED(hr))
410 return dev_mode; 410 return dev_mode;
411 411
412 HPTPROVIDER provider = NULL; 412 HPTPROVIDER provider = NULL;
413 hr = printing::XPSModule::OpenProvider(printer_name, 1, &provider); 413 hr = printing::XPSModule::OpenProvider(printer_name, 1, &provider);
414 if (SUCCEEDED(hr)) { 414 if (SUCCEEDED(hr)) {
415 ULONG size = 0; 415 ULONG size = 0;
416 DEVMODE* dm = NULL; 416 DEVMODE* dm = NULL;
417 // Use kPTJobScope, because kPTDocumentScope breaks duplex. 417 // Use kPTJobScope, because kPTDocumentScope breaks duplex.
418 hr = printing::XPSModule::ConvertPrintTicketToDevMode( 418 hr = printing::XPSModule::ConvertPrintTicketToDevMode(
419 provider, pt_stream.get(), kUserDefaultDevmode, kPTJobScope, &size, &dm, 419 provider, pt_stream.Get(), kUserDefaultDevmode, kPTJobScope, &size, &dm,
420 NULL); 420 NULL);
421 if (SUCCEEDED(hr)) { 421 if (SUCCEEDED(hr)) {
422 // Correct DEVMODE using DocumentProperties. See documentation for 422 // Correct DEVMODE using DocumentProperties. See documentation for
423 // PTConvertPrintTicketToDevMode. 423 // PTConvertPrintTicketToDevMode.
424 dev_mode = CreateDevMode(printer.Get(), dm); 424 dev_mode = CreateDevMode(printer.Get(), dm);
425 printing::XPSModule::ReleaseMemory(dm); 425 printing::XPSModule::ReleaseMemory(dm);
426 } 426 }
427 printing::XPSModule::CloseProvider(provider); 427 printing::XPSModule::CloseProvider(provider);
428 } 428 }
429 return dev_mode; 429 return dev_mode;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 *canceled = (result == IDCANCEL); 553 *canceled = (result == IDCANCEL);
554 if (result != IDOK) 554 if (result != IDOK)
555 return std::unique_ptr<DEVMODE, base::FreeDeleter>(); 555 return std::unique_ptr<DEVMODE, base::FreeDeleter>();
556 int size = out->dmSize; 556 int size = out->dmSize;
557 int extra_size = out->dmDriverExtra; 557 int extra_size = out->dmDriverExtra;
558 CHECK_GE(buffer_size, size + extra_size); 558 CHECK_GE(buffer_size, size + extra_size);
559 return out; 559 return out;
560 } 560 }
561 561
562 } // namespace printing 562 } // namespace printing
OLDNEW
« no previous file with comments | « printing/backend/print_backend_win.cc ('k') | remoting/host/audio_capturer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698