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

Side by Side Diff: chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js

Issue 2984843003: MD Settings: Convert all usages of .bind(this) to use ES6 arrow function. (Closed)
Patch Set: Resolve conflicts. Created 3 years, 4 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 unified diff | Download patch
OLDNEW
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
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 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/prefs/prefs.js ('k') | chrome/browser/resources/settings/reset_page/reset_profile_dialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698