| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/print_system_task_proxy.h" | 5 #include "chrome/browser/printing/print_system_task_proxy.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 file_util::Delete(ppd_file_path, false); | 416 file_util::Delete(ppd_file_path, false); |
| 417 return; | 417 return; |
| 418 } | 418 } |
| 419 | 419 |
| 420 ppd_file_t* ppd = ppdOpenFile(ppd_file_path.value().c_str()); | 420 ppd_file_t* ppd = ppdOpenFile(ppd_file_path.value().c_str()); |
| 421 if (ppd) { | 421 if (ppd) { |
| 422 #if !defined(OS_MACOSX) | 422 #if !defined(OS_MACOSX) |
| 423 printing_internal::mark_lpoptions(printer_name, &ppd); | 423 printing_internal::mark_lpoptions(printer_name, &ppd); |
| 424 #endif | 424 #endif |
| 425 ppd_choice_t* duplex_choice = ppdFindMarkedChoice(ppd, kDuplex); | 425 ppd_choice_t* duplex_choice = ppdFindMarkedChoice(ppd, kDuplex); |
| 426 if (duplex_choice) { | 426 if (!duplex_choice) { |
| 427 ppd_option_t* option = ppdFindOption(ppd, kDuplex); | 427 ppd_option_t* option = ppdFindOption(ppd, kDuplex); |
| 428 if (option) | 428 if (option) |
| 429 duplex_choice = ppdFindChoice(option, option->defchoice); | 429 duplex_choice = ppdFindChoice(option, option->defchoice); |
| 430 } | 430 } |
| 431 | 431 |
| 432 if (duplex_choice) { | 432 if (duplex_choice) { |
| 433 if (base::strcasecmp(duplex_choice->choice, kDuplexNone) != 0) { | 433 if (base::strcasecmp(duplex_choice->choice, kDuplexNone) != 0) { |
| 434 set_duplex_as_default = true; | 434 set_duplex_as_default = true; |
| 435 default_duplex_setting_value = printing::LONG_EDGE; | 435 default_duplex_setting_value = printing::LONG_EDGE; |
| 436 } else { | 436 } else { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 base::Bind(&PrintSystemTaskProxy::SendPrinterCapabilities, this, | 535 base::Bind(&PrintSystemTaskProxy::SendPrinterCapabilities, this, |
| 536 settings_info.DeepCopy())); | 536 settings_info.DeepCopy())); |
| 537 } | 537 } |
| 538 | 538 |
| 539 void PrintSystemTaskProxy::SendPrinterCapabilities( | 539 void PrintSystemTaskProxy::SendPrinterCapabilities( |
| 540 DictionaryValue* settings_info) { | 540 DictionaryValue* settings_info) { |
| 541 if (handler_) | 541 if (handler_) |
| 542 handler_->SendPrinterCapabilities(*settings_info); | 542 handler_->SendPrinterCapabilities(*settings_info); |
| 543 delete settings_info; | 543 delete settings_info; |
| 544 } | 544 } |
| OLD | NEW |