Chromium Code Reviews| Index: chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h |
| diff --git a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h |
| index 8c30a2ed0996f5a4efff3753dd3f6e02cef99b36..d7f5d9355442f410d790ba75d576d90cf220e8ff 100644 |
| --- a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h |
| +++ b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h |
| @@ -5,8 +5,13 @@ |
| #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_ |
| #define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_CUPS_PRINTERS_HANDLER_H_ |
| +#include <memory> |
| +#include <string> |
| +#include <vector> |
| + |
| #include "base/memory/weak_ptr.h" |
| #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
| +#include "chromeos/printing/ppd_provider.h" |
| #include "chromeos/printing/printer_configuration.h" |
| #include "chromeos/printing/printer_discoverer.h" |
| #include "ui/shell_dialogs/select_file_dialog.h" |
| @@ -18,6 +23,9 @@ class ListValue; |
| class Profile; |
| namespace chromeos { |
| +namespace printing { |
| +class PpdProvider; |
| +} |
| namespace settings { |
| // Chrome OS CUPS printing settings page UI handler. |
| @@ -43,8 +51,31 @@ class CupsPrintersHandler : public ::settings::SettingsPageUIHandler, |
| void OnAddedPrinter(std::unique_ptr<Printer> printer, bool success); |
| void OnAddPrinterError(); |
| + // Get a list of all manufacturers for which we have at least one |
| + // model of printer supported. Takes no arguments, invokes |
| + // 'on-manufacturer-list-ready' with an Array<string> with the |
| + // result, or on-manufacturer-list-error with no arguments on error. |
|
xdai1
2016/11/02 21:52:32
nit: 'on-manufacturer-list-error'
Carlson
2016/11/02 22:32:49
Removed
|
| + void HandleGetCupsPrinterManufacturers(const base::ListValue* args); |
| + |
| + // Given a manufacturer, get a list of all models of printers for which |
| + // we can get drivers. Takes a single manufacturer string argument. |
| + // invokes |
|
xdai1
2016/11/02 21:52:32
nit: no line break here.
Carlson
2016/11/02 22:32:49
Done.
|
| + // 'on-model-list-ready' with an Array<string> with the |
| + // result, or on-model-list-error with no arguments on error. |
|
xdai1
2016/11/02 21:52:32
nit: 'on-model-list-error'
Carlson
2016/11/02 22:32:49
Removed
|
| + // on-model-list-ready is guaranteed to get at least one model. |
| + void HandleGetCupsPrinterModels(const base::ListValue* args); |
| + |
| void HandleSelectPPDFile(const base::ListValue* args); |
| + // PpdProvider callback handlers. |
| + void QueryAvailableManufacturersDone( |
| + chromeos::printing::PpdProvider::CallbackResultCode result_code, |
| + const chromeos::printing::PpdProvider::AvailablePrintersMap& available); |
| + void QueryAvailableModelsDone( |
| + const std::string manufacturer, |
| + chromeos::printing::PpdProvider::CallbackResultCode result_code, |
| + const chromeos::printing::PpdProvider::AvailablePrintersMap& available); |
| + |
| // ui::SelectFileDialog::Listener override: |
| void FileSelected(const base::FilePath& path, |
| int index, |
| @@ -58,6 +89,7 @@ class CupsPrintersHandler : public ::settings::SettingsPageUIHandler, |
| void OnDiscoveryDone() override; |
| std::unique_ptr<chromeos::PrinterDiscoverer> printer_discoverer_; |
| + std::unique_ptr<chromeos::printing::PpdProvider> ppd_provider_; |
| Profile* profile_; |
| scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |