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

Unified Diff: chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h

Issue 2468063003: Initial hookup of PpdProvider. (Closed)
Patch Set: string -> const string& 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b959644da24312905d2c88e1580972f2667b67bd 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 one argument, the callback id for the result.
+ // The callback will be invoked with {success: <boolean>, models:
+ // <Array<string>>}.
+ void HandleGetCupsPrinterManufacturers(const base::ListValue* args);
+
+ // Given a manufacturer, get a list of all models of printers for which we can
+ // get drivers. Takes two arguments - the callback id and the manufacturer
+ // name for which we want to list models. The callback will be called with
+ // {success: <boolean>, models: Array<string>}.
+ void HandleGetCupsPrinterModels(const base::ListValue* args);
+
void HandleSelectPPDFile(const base::ListValue* args);
+ // PpdProvider callback handlers.
+ void QueryAvailableManufacturersDone(
+ const std::string& js_callback,
+ chromeos::printing::PpdProvider::CallbackResultCode result_code,
+ const chromeos::printing::PpdProvider::AvailablePrintersMap& available);
+ void QueryAvailableModelsDone(
+ const std::string& js_callback,
+ 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_;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698