| OLD | NEW |
| 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 "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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // printing_internal namespace | 113 } // printing_internal namespace |
| 114 #endif | 114 #endif |
| 115 | 115 |
| 116 using content::BrowserThread; | 116 using content::BrowserThread; |
| 117 | 117 |
| 118 namespace { | 118 namespace { |
| 119 | 119 |
| 120 const char kPrinterId[] = "printerId"; |
| 120 const char kDisableColorOption[] = "disableColorOption"; | 121 const char kDisableColorOption[] = "disableColorOption"; |
| 121 const char kSetColorAsDefault[] = "setColorAsDefault"; | 122 const char kSetColorAsDefault[] = "setColorAsDefault"; |
| 122 const char kSetDuplexAsDefault[] = "setDuplexAsDefault"; | 123 const char kSetDuplexAsDefault[] = "setDuplexAsDefault"; |
| 123 const char kPrinterColorModelForBlack[] = "printerColorModelForBlack"; | 124 const char kPrinterColorModelForBlack[] = "printerColorModelForBlack"; |
| 124 const char kPrinterColorModelForColor[] = "printerColorModelForColor"; | 125 const char kPrinterColorModelForColor[] = "printerColorModelForColor"; |
| 125 const char kPrinterDefaultDuplexValue[] = "printerDefaultDuplexValue"; | 126 const char kPrinterDefaultDuplexValue[] = "printerDefaultDuplexValue"; |
| 126 | 127 |
| 127 #if defined(OS_WIN) | 128 #if defined(OS_WIN) |
| 128 const char kPskColor[] = "psk:Color"; | 129 const char kPskColor[] = "psk:Color"; |
| 129 const char kPskGray[] = "psk:Grayscale"; | 130 const char kPskGray[] = "psk:Grayscale"; |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 &default_duplex_setting_value); | 553 &default_duplex_setting_value); |
| 553 #else | 554 #else |
| 554 NOTIMPLEMENTED(); | 555 NOTIMPLEMENTED(); |
| 555 #endif | 556 #endif |
| 556 bool disable_color_options = (!printer_color_space_for_color || | 557 bool disable_color_options = (!printer_color_space_for_color || |
| 557 !printer_color_space_for_black || | 558 !printer_color_space_for_black || |
| 558 (printer_color_space_for_color == | 559 (printer_color_space_for_color == |
| 559 printer_color_space_for_black)); | 560 printer_color_space_for_black)); |
| 560 | 561 |
| 561 DictionaryValue settings_info; | 562 DictionaryValue settings_info; |
| 563 settings_info.SetString(kPrinterId, printer_name); |
| 562 settings_info.SetBoolean(kDisableColorOption, disable_color_options); | 564 settings_info.SetBoolean(kDisableColorOption, disable_color_options); |
| 563 if (printer_color_space_for_color == printing::UNKNOWN_COLOR_MODEL) | 565 if (printer_color_space_for_color == printing::UNKNOWN_COLOR_MODEL) |
| 564 printer_color_space_for_color = printing::COLOR; | 566 printer_color_space_for_color = printing::COLOR; |
| 565 | 567 |
| 566 if (printer_color_space_for_black == printing::UNKNOWN_COLOR_MODEL) | 568 if (printer_color_space_for_black == printing::UNKNOWN_COLOR_MODEL) |
| 567 printer_color_space_for_black = printing::GRAY; | 569 printer_color_space_for_black = printing::GRAY; |
| 568 | 570 |
| 569 if (disable_color_options || | 571 if (disable_color_options || |
| 570 PrintPreviewHandler::GetStickySettings()->color_model() == | 572 PrintPreviewHandler::GetStickySettings()->color_model() == |
| 571 printing::UNKNOWN_COLOR_MODEL) { | 573 printing::UNKNOWN_COLOR_MODEL) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 589 base::Bind(&PrintSystemTaskProxy::SendPrinterCapabilities, this, | 591 base::Bind(&PrintSystemTaskProxy::SendPrinterCapabilities, this, |
| 590 settings_info.DeepCopy())); | 592 settings_info.DeepCopy())); |
| 591 } | 593 } |
| 592 | 594 |
| 593 void PrintSystemTaskProxy::SendPrinterCapabilities( | 595 void PrintSystemTaskProxy::SendPrinterCapabilities( |
| 594 DictionaryValue* settings_info) { | 596 DictionaryValue* settings_info) { |
| 595 if (handler_) | 597 if (handler_) |
| 596 handler_->SendPrinterCapabilities(*settings_info); | 598 handler_->SendPrinterCapabilities(*settings_info); |
| 597 delete settings_info; | 599 delete settings_info; |
| 598 } | 600 } |
| OLD | NEW |