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

Unified Diff: chrome/browser/resources/md_history/list_container.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: learn_the_alphabet 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/list_container.js
diff --git a/chrome/browser/resources/md_history/list_container.js b/chrome/browser/resources/md_history/list_container.js
index b4e348a68351d78023581b87fa98670d52512677..4ddd2209ef31ed9e1814bedffcc1d3c2b286c353 100644
--- a/chrome/browser/resources/md_history/list_container.js
+++ b/chrome/browser/resources/md_history/list_container.js
@@ -113,6 +113,11 @@ Polymer({
deleteSelectedWithPrompt: function() {
if (!loadTimeData.getBoolean('allowDeletingHistory'))
return;
+
+ var browserService = md_history.BrowserService.getInstance();
+ browserService.recordAction('RemoveSelected');
+ if (this.queryState.searchTerm != '')
+ browserService.recordAction('SearchResultRemove');
this.$.dialog.get().then(function(dialog) {
dialog.showModal();
});
@@ -161,6 +166,9 @@ Polymer({
/** @private */
onDialogConfirmTap_: function() {
+ md_history.BrowserService.getInstance().recordAction(
+ 'ConfirmRemoveSelected');
+
this.getSelectedList_().deleteSelected();
var dialog = assert(this.$.dialog.getIfExists());
dialog.close();
@@ -168,6 +176,9 @@ Polymer({
/** @private */
onDialogCancelTap_: function() {
+ md_history.BrowserService.getInstance().recordAction(
+ 'CancelRemoveSelected');
+
var dialog = assert(this.$.dialog.getIfExists());
dialog.close();
},
@@ -199,6 +210,9 @@ Polymer({
/** @private */
onMoreFromSiteTap_: function() {
+ md_history.BrowserService.getInstance().recordAction(
+ 'EntryMenuShowMoreFromSite');
+
var menu = assert(this.$.sharedMenu.getIfExists());
this.fire('search-domain', {domain: menu.itemData.item.domain});
menu.closeMenu();
@@ -206,16 +220,31 @@ Polymer({
/** @private */
onRemoveFromHistoryTap_: function() {
+ var browserService = md_history.BrowserService.getInstance();
+ browserService.recordAction('EntryMenuRemoveFromHistory');
var menu = assert(this.$.sharedMenu.getIfExists());
var itemData = menu.itemData;
- md_history.BrowserService.getInstance()
- .deleteItems([itemData.item])
+ browserService.deleteItems([itemData.item])
.then(function(items) {
this.getSelectedList_().removeItemsByPath([itemData.path]);
// This unselect-all is to reset the toolbar when deleting a selected
// item. TODO(tsergeant): Make this automatic based on observing list
// modifications.
this.fire('unselect-all');
+
+ var index = itemData.index;
+ if (index == undefined)
+ return;
+
+ var browserService = md_history.BrowserService.getInstance();
+ browserService.recordHistogram(
+ 'HistoryPage.RemoveEntryPosition', index,
+ UMA_MAX_BUCKET_VALUE);
+ if (index <= UMA_MAX_SUBSET_BUCKET_VALUE) {
+ browserService.recordHistogram(
+ 'HistoryPage.RemoveEntryPositionSubset', index,
+ UMA_MAX_SUBSET_BUCKET_VALUE);
+ }
}.bind(this));
menu.closeMenu();
},
« no previous file with comments | « chrome/browser/resources/md_history/list_container.html ('k') | chrome/browser/resources/md_history/side_bar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698