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

Unified Diff: chrome/browser/resources/file_manager/js/navigation_list.js

Issue 22634008: Add histgrams to Folder shortcut feature in Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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/file_manager/js/navigation_list.js
diff --git a/chrome/browser/resources/file_manager/js/navigation_list.js b/chrome/browser/resources/file_manager/js/navigation_list.js
index 481e05d9481fa6eb8eb4b3628b68e166fec1f5c4..56ee87472b7ea8dddc39944c758329b1d9a3e79a 100644
--- a/chrome/browser/resources/file_manager/js/navigation_list.js
+++ b/chrome/browser/resources/file_manager/js/navigation_list.js
@@ -313,6 +313,7 @@ NavigationList.prototype.renderRoot_ = function(path) {
var handleClick = function() {
if (item.selected && path !== this.directoryModel_.getCurrentDirPath()) {
+ metrics.recordUserAction('FolderShortcut.Navigate');
this.directoryModel_.changeDirectory(path);
}
}.bind(this);
@@ -349,6 +350,7 @@ NavigationList.prototype.setContextMenu = function(menu) {
/**
* Selects the n-th item from the list.
+ *
* @param {number} index Item index.
* @return {boolean} True for success, otherwise false.
*/
@@ -361,9 +363,12 @@ NavigationList.prototype.selectByIndex = function(index) {
return false;
// Prevents double-moving to the current directory.
+ // eg. When user clicks the item, changing directory has already been done in
+ // click handler.
if (this.directoryModel_.getCurrentDirEntry().fullPath == newPath)
return false;
+ metrics.recordUserAction('FolderShortcut.Navigate');
this.directoryModel_.changeDirectory(newPath);
return true;
};

Powered by Google App Engine
This is Rietveld 408576698