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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 * corresponding to the |toDialog|. | 552 * corresponding to the |toDialog|. |
553 * @private | 553 * @private |
554 */ | 554 */ |
555 switchDialog_: function(fromDialog, toDialog, domIfBooleanName) { | 555 switchDialog_: function(fromDialog, toDialog, domIfBooleanName) { |
556 this.previousDialog_ = fromDialog; | 556 this.previousDialog_ = fromDialog; |
557 this.currentDialog_ = toDialog; | 557 this.currentDialog_ = toDialog; |
558 | 558 |
559 this.set(domIfBooleanName, true); | 559 this.set(domIfBooleanName, true); |
560 this.async(function() { | 560 this.async(function() { |
561 var dialog = this.$$(toDialog); | 561 var dialog = this.$$(toDialog); |
562 dialog.addEventListener('close', function() { | 562 dialog.addEventListener('close', () => { |
563 this.set(domIfBooleanName, false); | 563 this.set(domIfBooleanName, false); |
564 }.bind(this)); | 564 }); |
565 }); | 565 }); |
566 }, | 566 }, |
567 | 567 |
568 /** | 568 /** |
569 * @param {boolean} success | 569 * @param {boolean} success |
570 * @param {string} printerName | 570 * @param {string} printerName |
571 * @private | 571 * @private |
572 */ | 572 */ |
573 onAddPrinter_: function(success, printerName) { | 573 onAddPrinter_: function(success, printerName) { |
574 this.$$('add-printer-configuring-dialog').close(); | 574 this.$$('add-printer-configuring-dialog').close(); |
575 if (success) | 575 if (success) |
576 return; | 576 return; |
577 | 577 |
578 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { | 578 if (this.previousDialog_ == AddPrinterDialogs.MANUFACTURER) { |
579 this.setupFailed = true; | 579 this.setupFailed = true; |
580 } | 580 } |
581 }, | 581 }, |
582 }); | 582 }); |
OLD | NEW |