| 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/print_preview/printer_backend_proxy.h" | 5 #include "chrome/browser/ui/webui/print_preview/printer_backend_proxy.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 base::Bind(cb, "")); | 180 base::Bind(cb, "")); |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 void EnumeratePrinters(const EnumeratePrintersCallback& cb) override { | 183 void EnumeratePrinters(const EnumeratePrintersCallback& cb) override { |
| 184 // PrintersManager is not thread safe and must be called from the UI | 184 // PrintersManager is not thread safe and must be called from the UI |
| 185 // thread. | 185 // thread. |
| 186 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 186 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 187 | 187 |
| 188 PrinterList printer_list; | 188 PrinterList printer_list; |
| 189 | 189 |
| 190 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 190 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 191 switches::kEnableNativeCups)) { | 191 switches::kDisableNativeCups)) { |
| 192 AddPrintersToList(prefs_->GetPrinters(), &printer_list); | 192 AddPrintersToList(prefs_->GetPrinters(), &printer_list); |
| 193 AddPrintersToList(prefs_->GetRecommendedPrinters(), &printer_list); | 193 AddPrintersToList(prefs_->GetRecommendedPrinters(), &printer_list); |
| 194 } | 194 } |
| 195 | 195 |
| 196 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 196 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
| 197 base::Bind(cb, printer_list)); | 197 base::Bind(cb, printer_list)); |
| 198 }; | 198 }; |
| 199 | 199 |
| 200 void ConfigurePrinterAndFetchCapabilities( | 200 void ConfigurePrinterAndFetchCapabilities( |
| 201 const std::string& printer_name, | 201 const std::string& printer_name, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 230 }; | 230 }; |
| 231 | 231 |
| 232 } // namespace | 232 } // namespace |
| 233 | 233 |
| 234 std::unique_ptr<PrinterBackendProxy> PrinterBackendProxy::Create( | 234 std::unique_ptr<PrinterBackendProxy> PrinterBackendProxy::Create( |
| 235 Profile* profile) { | 235 Profile* profile) { |
| 236 return base::MakeUnique<PrinterBackendProxyChromeos>(profile); | 236 return base::MakeUnique<PrinterBackendProxyChromeos>(profile); |
| 237 } | 237 } |
| 238 | 238 |
| 239 } // namespace printing | 239 } // namespace printing |
| OLD | NEW |