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

Side by Side Diff: chrome/browser/resources/settings/controls/pref_control_behavior.js

Issue 2984843003: MD Settings: Convert all usages of .bind(this) to use ES6 arrow function. (Closed)
Patch Set: Resolve conflicts. Created 3 years, 5 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 * @polymerBehavior Tracks the initialization of a specified preference and 6 * @polymerBehavior Tracks the initialization of a specified preference and
7 * logs an error if the pref is not defined after prefs have been fetched. 7 * logs an error if the pref is not defined after prefs have been fetched.
8 */ 8 */
9 var PrefControlBehavior = { 9 var PrefControlBehavior = {
10 properties: { 10 properties: {
(...skipping 11 matching lines...) Expand all
22 /** @override */ 22 /** @override */
23 ready: function() { 23 ready: function() {
24 this.validatePref_(); 24 this.validatePref_();
25 }, 25 },
26 26
27 /** 27 /**
28 * Logs an error once prefs are initialized if the tracked pref is not found. 28 * Logs an error once prefs are initialized if the tracked pref is not found.
29 * @private 29 * @private
30 */ 30 */
31 validatePref_: function() { 31 validatePref_: function() {
32 CrSettingsPrefs.initialized.then(function() { 32 CrSettingsPrefs.initialized.then(() => {
33 if (!this.pref) { 33 if (!this.pref) {
34 var error = 'Pref not found for element ' + this.tagName; 34 var error = 'Pref not found for element ' + this.tagName;
35 if (this.id) 35 if (this.id)
36 error += '#' + this.id; 36 error += '#' + this.id;
37 error += ' in ' + this.domHost.tagName; 37 error += ' in ' + this.domHost.tagName;
38 console.error(error); 38 console.error(error);
39 } 39 }
40 }.bind(this)); 40 });
41 }, 41 },
42 }; 42 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698