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

Unified Diff: chrome/browser/resources/settings/settings_main/settings_main.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/settings_main/settings_main.js
diff --git a/chrome/browser/resources/settings/settings_main/settings_main.js b/chrome/browser/resources/settings/settings_main/settings_main.js
index d81ee241c326b0b7f029cafc09e9f2e115f2cdb5..df1eb65bbc8c10f6d80bac7e78fc2ab346687f64 100644
--- a/chrome/browser/resources/settings/settings_main/settings_main.js
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js
@@ -107,10 +107,10 @@ Polymer({
window.removeEventListener('resize', this.boundScroll_);
this.boundScroll_ = null;
} else if (this.overscroll_ && !this.boundScroll_) {
- this.boundScroll_ = function() {
+ this.boundScroll_ = () => {
if (!this.ignoreScroll_)
this.setOverscroll_(0);
- }.bind(this);
+ };
this.offsetParent.addEventListener('scroll', this.boundScroll_);
window.addEventListener('resize', this.boundScroll_);
}
@@ -184,11 +184,11 @@ Polymer({
this.updateOverscrollForPage_();
// Wait for any other changes, then calculate the overflow padding again.
- setTimeout(function() {
+ setTimeout(() => {
// Ensure any dom-if reflects the current properties.
Polymer.dom.flush();
this.updateOverscrollForPage_();
- }.bind(this));
+ });
},
/**
@@ -259,11 +259,11 @@ Polymer({
this.inSearchMode_ = true;
this.toolbarSpinnerActive = true;
- return new Promise(function(resolve, reject) {
- setTimeout(function() {
+ return new Promise((resolve, reject) => {
+ setTimeout(() => {
var whenSearchDone =
assert(this.getPage_(settings.routes.BASIC)).searchContents(query);
- whenSearchDone.then(function(result) {
+ whenSearchDone.then(result => {
resolve();
if (result.canceled) {
// Nothing to do here. A previous search request was canceled
@@ -285,8 +285,8 @@ Polymer({
loadTimeData.getStringF('searchResults', query)
});
}
- }.bind(this));
- }.bind(this), 0);
- }.bind(this));
+ });
+ }, 0);
+ });
},
});

Powered by Google App Engine
This is Rietveld 408576698