| 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/ui/webui/print_preview/print_preview_handler.h" | 5 #include "chrome/browser/ui/webui/print_preview/print_preview_handler.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 const std::string& printer_name = printer_name_description.first; | 416 const std::string& printer_name = printer_name_description.first; |
| 417 const std::string& printer_description = printer_name_description.second; | 417 const std::string& printer_description = printer_name_description.second; |
| 418 printer_info->SetString(printing::kSettingPrinterName, printer_name); | 418 printer_info->SetString(printing::kSettingPrinterName, printer_name); |
| 419 printer_info->SetString(printing::kSettingPrinterDescription, | 419 printer_info->SetString(printing::kSettingPrinterDescription, |
| 420 printer_description); | 420 printer_description); |
| 421 | 421 |
| 422 auto options = base::MakeUnique<base::DictionaryValue>(); | 422 auto options = base::MakeUnique<base::DictionaryValue>(); |
| 423 for (const auto opt_it : printer.options) | 423 for (const auto opt_it : printer.options) |
| 424 options->SetString(opt_it.first, opt_it.second); | 424 options->SetString(opt_it.first, opt_it.second); |
| 425 | 425 |
| 426 printer_info->SetBoolean( |
| 427 kCUPSEnterprisePrinter, |
| 428 base::ContainsKey(printer.options, kCUPSEnterprisePrinter) && |
| 429 printer.options.at(kCUPSEnterprisePrinter) == kValueTrue); |
| 430 |
| 426 printer_info->Set(printing::kSettingPrinterOptions, std::move(options)); | 431 printer_info->Set(printing::kSettingPrinterOptions, std::move(options)); |
| 427 | 432 |
| 428 printers->Append(std::move(printer_info)); | 433 printers->Append(std::move(printer_info)); |
| 429 | 434 |
| 430 VLOG(1) << "Found printer " << printer_name << " with device name " | 435 VLOG(1) << "Found printer " << printer_name << " with device name " |
| 431 << printer.printer_name; | 436 << printer.printer_name; |
| 432 } | 437 } |
| 433 } | 438 } |
| 434 | 439 |
| 435 base::LazyInstance<printing::StickySettings> g_sticky_settings = | 440 base::LazyInstance<printing::StickySettings> g_sticky_settings = |
| (...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 | 1797 |
| 1793 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { | 1798 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { |
| 1794 if (gaia_cookie_manager_service_) | 1799 if (gaia_cookie_manager_service_) |
| 1795 gaia_cookie_manager_service_->RemoveObserver(this); | 1800 gaia_cookie_manager_service_->RemoveObserver(this); |
| 1796 } | 1801 } |
| 1797 | 1802 |
| 1798 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1803 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
| 1799 const base::Closure& closure) { | 1804 const base::Closure& closure) { |
| 1800 pdf_file_saved_closure_ = closure; | 1805 pdf_file_saved_closure_ = closure; |
| 1801 } | 1806 } |
| OLD | NEW |