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

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

Issue 2329143002: NOT FOR REVIEW. SAMPLE CODE ONLY. (Closed)
Patch Set: rebase Created 4 years, 3 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 | « no previous file | chrome/browser/resources/settings/printing_page/cups_printer_details_page.js » ('j') | 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 b8dc24498eb27f9aa1ed0bdceab67cbd6de089fa..2e8e5ddbf7981238dd91eea8b7f9729a04add0b0 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
@@ -108,34 +108,6 @@ Polymer({
/** @private */
onAddressChanged_: function() {
- this.$.searchInProgress.hidden = false;
- this.$.searchFound.hidden = true;
- this.$.searchNotFound.hidden = true;
-
- var value = this.$.printerAddressInput.value;
- if (this.isValidIpAddress_(value)) {
- // TODO(xdai): Check if the printer address exists after the API is ready.
- this.$.searchInProgress.hidden = true;
- this.$.searchFound.hidden = false;
- this.$.searchNotFound.hidden = true;
- } else {
- this.$.searchInProgress.hidden = true;
- this.$.searchFound.hidden = true;
- this.$.searchNotFound.hidden = false;
- }
- },
-
- /**
- * @param {string} ip
- * @return {boolean}
- * @private
- */
- isValidIpAddress_: function(ip) {
- var addressRegex = RegExp('^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.' +
- '([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.' +
- '([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.' +
- '([01]?\\d\\d?|2[0-4]\\d|25[0-5])$');
- return addressRegex.test(ip);
},
/**
@@ -145,8 +117,7 @@ Polymer({
* @private
*/
addPrinterNotAllowed_: function(printerName, printerAddress) {
- return !printerName || !printerAddress ||
- !this.isValidIpAddress_(printerAddress);
+ return !printerName || !printerAddress;
},
});
@@ -286,6 +257,8 @@ Polymer({
openConfiguringPrinterDialog_: function() {
this.switchDialog_(this.currentDialog_, AddPrinterDialogs.CONFIGURING,
'showConfiguringDialog_');
+ settings.CupsPrintersBrowserProxyImpl.getInstance().
+ addCupsPrinter(this.newPrinter);
},
/** @private */
« no previous file with comments | « no previous file | chrome/browser/resources/settings/printing_page/cups_printer_details_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698