OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview 'settings-cups-add-printer-dialog' includes multiple dialogs to | 6 * @fileoverview 'settings-cups-add-printer-dialog' includes multiple dialogs to |
7 * set up a new CUPS printer. | 7 * set up a new CUPS printer. |
8 * Subdialogs include: | 8 * Subdialogs include: |
9 * - 'add-printer-discovery-dialog' is a dialog showing discovered printers on | 9 * - 'add-printer-discovery-dialog' is a dialog showing discovered printers on |
10 * the network that are available for setup. | 10 * the network that are available for setup. |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 * corresponding to the |toDialog|. | 550 * corresponding to the |toDialog|. |
551 * @private | 551 * @private |
552 */ | 552 */ |
553 switchDialog_: function(fromDialog, toDialog, domIfBooleanName) { | 553 switchDialog_: function(fromDialog, toDialog, domIfBooleanName) { |
554 this.previousDialog_ = fromDialog; | 554 this.previousDialog_ = fromDialog; |
555 this.currentDialog_ = toDialog; | 555 this.currentDialog_ = toDialog; |
556 | 556 |
557 this.set(domIfBooleanName, true); | 557 this.set(domIfBooleanName, true); |
558 this.async(function() { | 558 this.async(function() { |
559 var dialog = this.$$(toDialog); | 559 var dialog = this.$$(toDialog); |
560 dialog.addEventListener('close', function() { | 560 dialog.addEventListener('close', () => { |
561 this.set(domIfBooleanName, false); | 561 this.set(domIfBooleanName, false); |
562 }.bind(this)); | 562 }); |
563 }); | 563 }); |
564 }, | 564 }, |
565 | 565 |
566 /** | 566 /** |
567 * @param {boolean} success | 567 * @param {boolean} success |
568 * @param {string} printerName | 568 * @param {string} printerName |
569 * @private | 569 * @private |
570 */ | 570 */ |
571 onAddPrinter_: function(success, printerName) { | 571 onAddPrinter_: function(success, printerName) { |
572 this.$$('add-printer-configuring-dialog').close(); | 572 this.$$('add-printer-configuring-dialog').close(); |
573 if (success) | 573 if (success) |
574 return; | 574 return; |
575 | 575 |
576 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { | 576 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { |
577 this.setupFailed = true; | 577 this.setupFailed = true; |
578 } | 578 } |
579 }, | 579 }, |
580 }); | 580 }); |
OLD | NEW |