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

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

Issue 170013002: Removed unnecessary comparison checking bits in DEVMODE::dmFields. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « printing/backend/print_backend_win.cc ('k') | no next file » | 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 printing::XPSModule::CloseProvider(provider); 425 printing::XPSModule::CloseProvider(provider);
426 } 426 }
427 return scoped_dev_mode.Pass(); 427 return scoped_dev_mode.Pass();
428 } 428 }
429 429
430 scoped_ptr<DEVMODE[]> CreateDevModeWithColor(HANDLE printer, 430 scoped_ptr<DEVMODE[]> CreateDevModeWithColor(HANDLE printer,
431 const base::string16& printer_name, 431 const base::string16& printer_name,
432 bool color) { 432 bool color) {
433 scoped_ptr<DEVMODE[]> default = CreateDevMode(printer, NULL); 433 scoped_ptr<DEVMODE[]> default = CreateDevMode(printer, NULL);
434 if (default && (default.get()->dmFields & DM_COLOR) && 434 if (default && (default.get()->dmFields & DM_COLOR) &&
435 (default.get()->dmColor == DMCOLOR_COLOR) == color) { 435 ((default.get()->dmColor == DMCOLOR_COLOR) == color)) {
436 return default.Pass(); 436 return default.Pass();
437 } 437 }
438 438
439 default.get()->dmFields |= DM_COLOR; 439 default.get()->dmFields |= DM_COLOR;
440 default.get()->dmColor = color ? DMCOLOR_COLOR : DMCOLOR_MONOCHROME; 440 default.get()->dmColor = color ? DMCOLOR_COLOR : DMCOLOR_MONOCHROME;
441 441
442 DriverInfo6 info_6; 442 DriverInfo6 info_6;
443 if (!info_6.Init(printer)) 443 if (!info_6.Init(printer))
444 return default.Pass(); 444 return default.Pass();
445 445
(...skipping 27 matching lines...) Expand all
473 scoped_ptr<DEVMODE[]> out( 473 scoped_ptr<DEVMODE[]> out(
474 reinterpret_cast<DEVMODE*>(new uint8[buffer_size])); 474 reinterpret_cast<DEVMODE*>(new uint8[buffer_size]));
475 flags |= DM_OUT_BUFFER; 475 flags |= DM_OUT_BUFFER;
476 if (DocumentProperties(NULL, printer, L"", out.get(), in, flags) != IDOK) 476 if (DocumentProperties(NULL, printer, L"", out.get(), in, flags) != IDOK)
477 return scoped_ptr<DEVMODE[]>(); 477 return scoped_ptr<DEVMODE[]>();
478 DCHECK_EQ(buffer_size, out.get()->dmSize + out.get()->dmDriverExtra); 478 DCHECK_EQ(buffer_size, out.get()->dmSize + out.get()->dmDriverExtra);
479 return out.Pass(); 479 return out.Pass();
480 } 480 }
481 481
482 } // namespace printing 482 } // namespace printing
OLDNEW
« no previous file with comments | « printing/backend/print_backend_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698