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

Unified Diff: chrome/browser/resources/md_history/list_container.js

Issue 2597573002: MD History/Downloads: convert .bind(this) and function property values to use => (Closed)
Patch Set: Created 4 years 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/md_history/list_container.js
diff --git a/chrome/browser/resources/md_history/list_container.js b/chrome/browser/resources/md_history/list_container.js
index b6c1ba2170396571dd22206fb1e4374e269a86ab..37d66f0bdb76deaa4cee101ae65e7eacd3725b9c 100644
--- a/chrome/browser/resources/md_history/list_container.js
+++ b/chrome/browser/resources/md_history/list_container.js
@@ -255,30 +255,28 @@ Polymer({
browserService.recordAction('EntryMenuRemoveFromHistory');
var menu = assert(this.$.sharedMenu.getIfExists());
var itemData = menu.itemData;
- browserService.deleteItems([itemData.item])
- .then(function(items) {
- // This unselect-all resets the toolbar when deleting a selected item
- // and clears selection state which can be invalid if items move
- // around during deletion.
- // TODO(tsergeant): Make this automatic based on observing list
- // modifications.
- this.fire('unselect-all');
- this.getSelectedList_().removeItemsByPath([itemData.path]);
-
- var index = itemData.index;
- if (index == undefined)
- return;
-
- var browserService = md_history.BrowserService.getInstance();
- browserService.recordHistogram(
- 'HistoryPage.RemoveEntryPosition',
- Math.min(index, UMA_MAX_BUCKET_VALUE), UMA_MAX_BUCKET_VALUE);
- if (index <= UMA_MAX_SUBSET_BUCKET_VALUE) {
- browserService.recordHistogram(
- 'HistoryPage.RemoveEntryPositionSubset', index,
- UMA_MAX_SUBSET_BUCKET_VALUE);
- }
- }.bind(this));
+ browserService.deleteItems([itemData.item]).then(items => {
+ // This unselect-all resets the toolbar when deleting a selected item and
+ // clears selection state which can be invalid if items move around during
+ // deletion. TODO(tsergeant): Make this automatic based on observing list
+ // modifications.
+ this.fire('unselect-all');
+ this.getSelectedList_().removeItemsByPath([itemData.path]);
+
+ var index = itemData.index;
+ if (index == undefined)
+ return;
+
+ var browserService = md_history.BrowserService.getInstance();
+ browserService.recordHistogram(
+ 'HistoryPage.RemoveEntryPosition',
+ Math.min(index, UMA_MAX_BUCKET_VALUE), UMA_MAX_BUCKET_VALUE);
+ if (index <= UMA_MAX_SUBSET_BUCKET_VALUE) {
+ browserService.recordHistogram(
+ 'HistoryPage.RemoveEntryPositionSubset', index,
+ UMA_MAX_SUBSET_BUCKET_VALUE);
+ }
+ });
menu.closeMenu();
},

Powered by Google App Engine
This is Rietveld 408576698