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

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

Issue 313723002: Convert local printer capabilites to CDD format to unify with cloud printers and PDF printer. This … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix clang reported errors. Created 6 years, 6 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 | « chrome/test/data/webui/print_preview.js ('k') | printing/backend/cups_helper_unittest.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/cups_helper.h" 5 #include "printing/backend/cups_helper.h"
6 6
7 #include <cups/ppd.h> 7 #include <cups/ppd.h>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 } 358 }
359 359
360 ppd_file_t* ppd = ppdOpenFile(ppd_file_path.value().c_str()); 360 ppd_file_t* ppd = ppdOpenFile(ppd_file_path.value().c_str());
361 if (!ppd) 361 if (!ppd)
362 return false; 362 return false;
363 363
364 printing::PrinterSemanticCapsAndDefaults caps; 364 printing::PrinterSemanticCapsAndDefaults caps;
365 #if !defined(OS_MACOSX) 365 #if !defined(OS_MACOSX)
366 MarkLpOptions(printer_name, &ppd); 366 MarkLpOptions(printer_name, &ppd);
367 #endif 367 #endif
368 caps.collate_capable = true;
369 caps.collate_default = true;
370 caps.copies_capable = true;
371
368 ppd_choice_t* duplex_choice = ppdFindMarkedChoice(ppd, kDuplex); 372 ppd_choice_t* duplex_choice = ppdFindMarkedChoice(ppd, kDuplex);
369 if (!duplex_choice) { 373 if (!duplex_choice) {
370 ppd_option_t* option = ppdFindOption(ppd, kDuplex); 374 ppd_option_t* option = ppdFindOption(ppd, kDuplex);
371 if (option) 375 if (option)
372 duplex_choice = ppdFindChoice(option, option->defchoice); 376 duplex_choice = ppdFindChoice(option, option->defchoice);
373 } 377 }
374 378
375 if (duplex_choice) { 379 if (duplex_choice) {
376 caps.duplex_capable = true; 380 caps.duplex_capable = true;
377 if (base::strcasecmp(duplex_choice->choice, kDuplexNone) != 0) 381 if (base::strcasecmp(duplex_choice->choice, kDuplexNone) != 0)
(...skipping 16 matching lines...) Expand all
394 caps.bw_model = cm_black; 398 caps.bw_model = cm_black;
395 399
396 ppdClose(ppd); 400 ppdClose(ppd);
397 base::DeleteFile(ppd_file_path, false); 401 base::DeleteFile(ppd_file_path, false);
398 402
399 *printer_info = caps; 403 *printer_info = caps;
400 return true; 404 return true;
401 } 405 }
402 406
403 } // namespace printing 407 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/test/data/webui/print_preview.js ('k') | printing/backend/cups_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698