| 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 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/ui/webui/print_preview/print_preview_handler.h" | 14 #include "chrome/browser/ui/webui/print_preview/print_preview_handler.h" |
| 15 #include "chrome/common/crash_keys.h" | 15 #include "chrome/common/crash_keys.h" |
| 16 #include "printing/backend/print_backend.h" | 16 #include "printing/backend/print_backend.h" |
| 17 #include "printing/print_job_constants.h" | 17 #include "printing/print_job_constants.h" |
| 18 #include "printing/print_settings.h" | 18 #include "printing/print_settings.h" |
| 19 | 19 |
| 20 #if defined(USE_CUPS) | 20 #if defined(USE_CUPS) |
| 21 #include <cups/cups.h> | 21 #include <cups/cups.h> |
| 22 #include <cups/ppd.h> | 22 #include <cups/ppd.h> |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 using content::BrowserThread; | 25 using content::BrowserThread; |
| 26 | 26 |
| 27 namespace { | |
| 28 | |
| 29 const char kPrinterId[] = "printerId"; | 27 const char kPrinterId[] = "printerId"; |
| 30 const char kDisableColorOption[] = "disableColorOption"; | 28 const char kDisableColorOption[] = "disableColorOption"; |
| 31 const char kSetDuplexAsDefault[] = "setDuplexAsDefault"; | 29 const char kSetDuplexAsDefault[] = "setDuplexAsDefault"; |
| 32 const char kPrinterColorModelForBlack[] = "printerColorModelForBlack"; | |
| 33 const char kPrinterColorModelForColor[] = "printerColorModelForColor"; | |
| 34 const char kPrinterDefaultDuplexValue[] = "printerDefaultDuplexValue"; | 30 const char kPrinterDefaultDuplexValue[] = "printerDefaultDuplexValue"; |
| 35 | 31 |
| 36 } // namespace | |
| 37 | |
| 38 PrintSystemTaskProxy::PrintSystemTaskProxy( | 32 PrintSystemTaskProxy::PrintSystemTaskProxy( |
| 39 const base::WeakPtr<PrintPreviewHandler>& handler, | 33 const base::WeakPtr<PrintPreviewHandler>& handler, |
| 40 printing::PrintBackend* print_backend, | 34 printing::PrintBackend* print_backend, |
| 41 bool has_logged_printers_count) | 35 bool has_logged_printers_count) |
| 42 : handler_(handler), | 36 : handler_(handler), |
| 43 print_backend_(print_backend), | 37 print_backend_(print_backend), |
| 44 has_logged_printers_count_(has_logged_printers_count) { | 38 has_logged_printers_count_(has_logged_printers_count) { |
| 45 } | 39 } |
| 46 | 40 |
| 47 PrintSystemTaskProxy::~PrintSystemTaskProxy() { | 41 PrintSystemTaskProxy::~PrintSystemTaskProxy() { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (handler_.get()) | 159 if (handler_.get()) |
| 166 handler_->SendPrinterCapabilities(*settings_info); | 160 handler_->SendPrinterCapabilities(*settings_info); |
| 167 delete settings_info; | 161 delete settings_info; |
| 168 } | 162 } |
| 169 | 163 |
| 170 void PrintSystemTaskProxy::SendFailedToGetPrinterCapabilities( | 164 void PrintSystemTaskProxy::SendFailedToGetPrinterCapabilities( |
| 171 const std::string& printer_name) { | 165 const std::string& printer_name) { |
| 172 if (handler_.get()) | 166 if (handler_.get()) |
| 173 handler_->SendFailedToGetPrinterCapabilities(printer_name); | 167 handler_->SendFailedToGetPrinterCapabilities(printer_name); |
| 174 } | 168 } |
| OLD | NEW |