Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/chromeos/printing/printer_configurer.h" | 5 #include "chrome/browser/chromeos/printing/printer_configurer.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | |
| 9 | 10 |
| 10 #include "base/bind.h" | 11 #include "base/bind.h" |
| 11 #include "base/callback.h" | 12 #include "base/callback.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 15 #include "chrome/browser/chromeos/printing/ppd_provider_factory.h" | 16 #include "chrome/browser/chromeos/printing/ppd_provider_factory.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chromeos/dbus/dbus_thread_manager.h" | 18 #include "chromeos/dbus/dbus_thread_manager.h" |
| 18 #include "chromeos/dbus/debug_daemon_client.h" | 19 #include "chromeos/dbus/debug_daemon_client.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 printer.id(), printer.uri(), ppd_contents, | 113 printer.id(), printer.uri(), ppd_contents, |
| 113 base::Bind(&PrinterConfigurerImpl::OnAddedPrinter, | 114 base::Bind(&PrinterConfigurerImpl::OnAddedPrinter, |
| 114 weak_factory_.GetWeakPtr(), printer, cb), | 115 weak_factory_.GetWeakPtr(), printer, cb), |
| 115 base::Bind(&PrinterConfigurerImpl::OnDbusError, | 116 base::Bind(&PrinterConfigurerImpl::OnDbusError, |
| 116 weak_factory_.GetWeakPtr(), cb)); | 117 weak_factory_.GetWeakPtr(), cb)); |
| 117 } | 118 } |
| 118 | 119 |
| 119 void ResolvePpdDone(const Printer& printer, | 120 void ResolvePpdDone(const Printer& printer, |
| 120 const PrinterSetupCallback& cb, | 121 const PrinterSetupCallback& cb, |
| 121 printing::PpdProvider::CallbackResultCode result, | 122 printing::PpdProvider::CallbackResultCode result, |
| 122 const std::string& ppd_contents) { | 123 const std::string& ppd_contents, |
| 124 const std::vector<std::string>& ppd_filters) { | |
|
skau
2017/04/11 16:59:37
Can you comment this as unused for now?
Carlson
2017/04/11 19:06:49
Done.
| |
| 123 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 125 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 124 switch (result) { | 126 switch (result) { |
| 125 case chromeos::printing::PpdProvider::SUCCESS: | 127 case chromeos::printing::PpdProvider::SUCCESS: |
| 126 DCHECK(!ppd_contents.empty()); | 128 DCHECK(!ppd_contents.empty()); |
| 127 AddPrinter(printer, ppd_contents, cb); | 129 AddPrinter(printer, ppd_contents, cb); |
| 128 break; | 130 break; |
| 129 case printing::PpdProvider::CallbackResultCode::NOT_FOUND: | 131 case printing::PpdProvider::CallbackResultCode::NOT_FOUND: |
| 130 cb.Run(PPD_NOT_FOUND); | 132 cb.Run(PPD_NOT_FOUND); |
| 131 break; | 133 break; |
| 132 case printing::PpdProvider::CallbackResultCode::SERVER_ERROR: | 134 case printing::PpdProvider::CallbackResultCode::SERVER_ERROR: |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 144 }; | 146 }; |
| 145 | 147 |
| 146 } // namespace | 148 } // namespace |
| 147 | 149 |
| 148 // static | 150 // static |
| 149 std::unique_ptr<PrinterConfigurer> PrinterConfigurer::Create(Profile* profile) { | 151 std::unique_ptr<PrinterConfigurer> PrinterConfigurer::Create(Profile* profile) { |
| 150 return base::MakeUnique<PrinterConfigurerImpl>(profile); | 152 return base::MakeUnique<PrinterConfigurerImpl>(profile); |
| 151 } | 153 } |
| 152 | 154 |
| 153 } // namespace chromeos | 155 } // namespace chromeos |
| OLD | NEW |