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

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

Issue 2255033002: [MD History] Copy stats from the old history page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sidebar_stats
Patch Set: add_stats Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_history/history_list_behavior.js
diff --git a/chrome/browser/resources/md_history/history_list_behavior.js b/chrome/browser/resources/md_history/history_list_behavior.js
index 230139f0f6593d0a306ad753f864088a55f16d7a..511c76d68faca7e7a7ba0bb8db2805a986506237 100644
--- a/chrome/browser/resources/md_history/history_list_behavior.js
+++ b/chrome/browser/resources/md_history/history_list_behavior.js
@@ -94,6 +94,7 @@ var HistoryListBehavior = {
.then(function() {
this.removeItemsByPath(Array.from(this.selectedPaths));
this.fire('unselect-all');
+ this.refreshItemIndexes();
}.bind(this));
},
@@ -164,7 +165,7 @@ var HistoryListBehavior = {
node.indexes.sort(function(a, b) { return b - a; });
node.indexes.forEach(function(index) {
if (node.leaf || this.removeItemsBeneathNode_(node.children[index])) {
- var item = array.splice(index, 1);
+ var item = array.splice(index, 1)[0];
splices.push({
index: index,
removed: [item],
@@ -172,6 +173,19 @@ var HistoryListBehavior = {
object: array,
type: 'splice'
});
+
+ if (item.index == undefined)
+ return;
+
+ var browserService = md_history.BrowserService.getInstance();
+ browserService.recordHistogram(
+ 'HistoryPage.RemoveEntryPosition', item.index,
+ UMA_MAX_BUCKET_VALUE);
+ if (item.index <= UMA_MAX_SUBSET_BUCKET_VALUE) {
+ browserService.recordHistogram(
+ 'HistoryPage.RemoveEntryPositionSubset', item.index,
+ UMA_MAX_SUBSET_BUCKET_VALUE);
+ }
}
}.bind(this));

Powered by Google App Engine
This is Rietveld 408576698