| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/webui/print_preview/printer_backend_proxy.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "printing/backend/print_backend.h" |
| 13 |
| 14 namespace printing { |
| 15 |
| 16 std::string GetDefaultPrinterOnBlockingPoolThread() { |
| 17 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
| 18 |
| 19 scoped_refptr<printing::PrintBackend> print_backend( |
| 20 PrintBackend::CreateInstance(nullptr)); |
| 21 |
| 22 std::string default_printer = print_backend->GetDefaultPrinterName(); |
| 23 VLOG(1) << "Default Printer: " << default_printer; |
| 24 return default_printer; |
| 25 } |
| 26 |
| 27 PrinterList EnumeratePrintersOnBlockingPoolThread(Profile* /* profile */) { |
| 28 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
| 29 |
| 30 scoped_refptr<PrintBackend> print_backend( |
| 31 PrintBackend::CreateInstance(nullptr)); |
| 32 |
| 33 PrinterList printer_list; |
| 34 print_backend->EnumeratePrinters(&printer_list); |
| 35 |
| 36 return printer_list; |
| 37 } |
| 38 |
| 39 } // namespace printing |
| OLD | NEW |