| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/settings/chromeos/cups_printers_handler.h" | 5 #include "chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/json/json_string_value_serializer.h" | 12 #include "base/json/json_string_value_serializer.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/metrics/histogram_macros.h" |
| 14 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 16 #include "base/threading/sequenced_task_runner_handle.h" | 17 #include "base/threading/sequenced_task_runner_handle.h" |
| 17 #include "base/values.h" | 18 #include "base/values.h" |
| 18 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/chromeos/printing/ppd_provider_factory.h" | 20 #include "chrome/browser/chromeos/printing/ppd_provider_factory.h" |
| 20 #include "chrome/browser/chromeos/printing/printer_configurer.h" | 21 #include "chrome/browser/chromeos/printing/printer_configurer.h" |
| 21 #include "chrome/browser/chromeos/printing/printer_discoverer.h" | 22 #include "chrome/browser/chromeos/printing/printer_discoverer.h" |
| 22 #include "chrome/browser/chromeos/printing/printers_manager_factory.h" | 23 #include "chrome/browser/chromeos/printing/printers_manager_factory.h" |
| 23 #include "chrome/browser/download/download_prefs.h" | 24 #include "chrome/browser/download/download_prefs.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 const std::vector<Printer>& printers) { | 404 const std::vector<Printer>& printers) { |
| 404 std::unique_ptr<base::ListValue> printers_list = | 405 std::unique_ptr<base::ListValue> printers_list = |
| 405 base::MakeUnique<base::ListValue>(); | 406 base::MakeUnique<base::ListValue>(); |
| 406 for (const auto& printer : printers) { | 407 for (const auto& printer : printers) { |
| 407 printers_list->Append(GetPrinterInfo(printer)); | 408 printers_list->Append(GetPrinterInfo(printer)); |
| 408 } | 409 } |
| 409 | 410 |
| 410 FireWebUIListener("on-printer-discovered", *printers_list); | 411 FireWebUIListener("on-printer-discovered", *printers_list); |
| 411 } | 412 } |
| 412 | 413 |
| 413 void CupsPrintersHandler::OnDiscoveryInitialScanDone() { | 414 void CupsPrintersHandler::OnDiscoveryInitialScanDone(int printer_count) { |
| 415 UMA_HISTOGRAM_COUNTS_100("Printing.CUPS.PrintersDiscovered", printer_count); |
| 414 FireWebUIListener("on-printer-discovery-done"); | 416 FireWebUIListener("on-printer-discovery-done"); |
| 415 } | 417 } |
| 416 | 418 |
| 417 } // namespace settings | 419 } // namespace settings |
| 418 } // namespace chromeos | 420 } // namespace chromeos |
| OLD | NEW |