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

Unified Diff: printing/backend/print_backend.h

Issue 1979903002: Print Preview: Get printer info with capabilities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cups_14
Patch Set: nit Created 4 years, 7 months 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
Index: printing/backend/print_backend.h
diff --git a/printing/backend/print_backend.h b/printing/backend/print_backend.h
index 56e357542469308bde7907f9988b900c6fa45086..5086d2047346f111cdd7ba5ed8bb94a0c5c2a9a1 100644
--- a/printing/backend/print_backend.h
+++ b/printing/backend/print_backend.h
@@ -21,6 +21,8 @@ class DictionaryValue;
// This is the interface for platform-specific code for a print backend
namespace printing {
+// Note: There are raw values. The |printer_name| and |printer_description|
+// require further interpretation on Mac. See existing callers for examples.
struct PRINTING_EXPORT PrinterBasicInfo {
PrinterBasicInfo();
PrinterBasicInfo(const PrinterBasicInfo& other);
@@ -33,7 +35,7 @@ struct PRINTING_EXPORT PrinterBasicInfo {
std::map<std::string, std::string> options;
};
-typedef std::vector<PrinterBasicInfo> PrinterList;
+using PrinterList = std::vector<PrinterBasicInfo>;
struct PRINTING_EXPORT PrinterSemanticCapsAndDefaults {
PrinterSemanticCapsAndDefaults();
@@ -89,9 +91,13 @@ class PRINTING_EXPORT PrintBackend
// Enumerates the list of installed local and network printers.
virtual bool EnumeratePrinters(PrinterList* printer_list) = 0;
- // Get the default printer name. Empty string if no default printer.
+ // Gets the default printer name. Empty string if no default printer.
virtual std::string GetDefaultPrinterName() = 0;
+ // Gets the basic printer info for a specific printer.
+ virtual bool GetPrinterBasicInfo(const std::string& printer_name,
+ PrinterBasicInfo* printer_info) = 0;
+
// Gets the semantic capabilities and defaults for a specific printer.
// This is usually a lighter implementation than GetPrinterCapsAndDefaults().
// NOTE: on some old platforms (WinXP without XPS pack)
@@ -112,7 +118,7 @@ class PRINTING_EXPORT PrintBackend
// Returns true if printer_name points to a valid printer.
virtual bool IsValidPrinter(const std::string& printer_name) = 0;
- // Allocate a print backend. If |print_backend_settings| is NULL, default
+ // Allocates a print backend. If |print_backend_settings| is nullptr, default
// settings will be used.
static scoped_refptr<PrintBackend> CreateInstance(
const base::DictionaryValue* print_backend_settings);
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_handler.cc ('k') | printing/backend/print_backend_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698