Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: chrome/browser/ui/webui/print_preview/printer_backend_proxy.cc

Issue 2463473002: Present the printer list from preferences for Chrome OS. (Closed)
Patch Set: add bug id Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 PrinterList printer_list;
Lei Zhang 2016/11/03 07:39:50 nit: move this down to line 34, and make line 34 t
skau 2016/11/03 21:58:27 Done.
30
31 scoped_refptr<PrintBackend> print_backend(
32 PrintBackend::CreateInstance(nullptr));
33
34 print_backend->EnumeratePrinters(&printer_list);
35
36 return printer_list;
37 }
38
39 } // namespace printing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698