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

Unified Diff: chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js

Issue 2866163003: [CUPS] Only allow set up a printer if manufacturer & model or the PPD file is specified. (Closed)
Patch Set: set up. Created 3 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
« no previous file with comments | « chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
diff --git a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
index d2270f7c1a2fe01b487d5cc35d01b936cc3ae8d7..761949d28d56cd3bf2285c76ffdeee2f10b41a48 100644
--- a/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
+++ b/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
@@ -287,6 +287,19 @@ Polymer({
getBaseName_: function(path) {
return path.substring(path.lastIndexOf('/') + 1);
},
+
+ /**
+ * @param {string} printerManufacturer
+ * @param {string} printerModel
+ * @param {string} printerPPDPath
+ * @return {boolean} Whether we have enough information to set up the printer
+ * @private
+ */
+ canAddPrinter_: function(printerManufacturer, printerModel, printerPPDPath) {
+ if ((printerManufacturer && printerModel) || printerPPDPath)
michaelpg 2017/05/08 23:46:57 nit: just return ((pM && pM) || pP) directly inste
xdai1 2017/05/09 00:34:23 Done.
+ return true;
+ return false;
+ },
});
Polymer({
« no previous file with comments | « chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698