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

Unified Diff: chrome/browser/resources/settings/search_settings.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/search_settings.js
diff --git a/chrome/browser/resources/settings/search_settings.js b/chrome/browser/resources/settings/search_settings.js
index 65c2cc6226ce9752a776f97be33c5f0fafa7251d..9a97d9a13134aed89ea41ff7ba466fcc505056ad 100644
--- a/chrome/browser/resources/settings/search_settings.js
+++ b/chrome/browser/resources/settings/search_settings.js
@@ -304,9 +304,9 @@ cr.define('settings', function() {
assert(!this.node.if);
this.node.if = true;
- return new Promise(function(resolve, reject) {
+ return new Promise((resolve, reject) => {
var parent = this.node.parentNode;
- parent.async(function() {
+ parent.async(() => {
var renderedNode =
parent.querySelector('[route-path="' + routePath + '"]');
// Register a SearchAndHighlightTask for the part of the DOM that was
@@ -314,8 +314,8 @@ cr.define('settings', function() {
this.request.queue_.addSearchAndHighlightTask(
new SearchAndHighlightTask(this.request, assert(renderedNode)));
resolve();
- }.bind(this));
- }.bind(this));
+ });
+ });
}
}
@@ -452,16 +452,16 @@ cr.define('settings', function() {
}
this.running_ = true;
- window.requestIdleCallback(function() {
+ window.requestIdleCallback(() => {
if (!this.request_.canceled) {
- task.exec().then(function() {
+ task.exec().then(() => {
this.running_ = false;
this.consumePending_();
- }.bind(this));
+ });
}
// Nothing to do otherwise. Since the request corresponding to this
// queue was canceled, the queue is disposed along with the request.
- }.bind(this));
+ });
return;
}
}
@@ -496,9 +496,9 @@ cr.define('settings', function() {
/** @private {!TaskQueue} */
this.queue_ = new TaskQueue(this);
- this.queue_.onEmpty(function() {
+ this.queue_.onEmpty(() => {
this.resolver.resolve(this);
- }.bind(this));
+ });
}
/**
@@ -588,11 +588,11 @@ cr.define('settings', function() {
var request = new SearchRequest(text, page);
this.activeRequests_.add(request);
request.start();
- return request.resolver.promise.then(function() {
+ return request.resolver.promise.then(() => {
// Stop tracking requests that finished.
this.activeRequests_.delete(request);
return request;
- }.bind(this));
+ });
}
}
cr.addSingletonGetter(SearchManagerImpl);

Powered by Google App Engine
This is Rietveld 408576698