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 16bd17bda2533b876a04a7a02b3eb5f9961be7f9..e4731913c876c71c90d05c33348d18dfc062e623 100644 |
--- a/chrome/browser/resources/file_manager/js/navigation_list.js |
+++ b/chrome/browser/resources/file_manager/js/navigation_list.js |
@@ -294,8 +294,10 @@ NavigationList.prototype.renderRoot_ = function(path) { |
item.setPath(path); |
var handleClick = function() { |
- if (item.selected && path !== this.directoryModel_.getCurrentDirPath()) |
+ if (item.selected && path !== this.directoryModel_.getCurrentDirPath()) { |
+ metrics.recordUserAction('FolderShortcut.Navigate'); |
this.changeDirectory_(path); |
+ } |
}.bind(this); |
item.addEventListener('click', handleClick); |
@@ -349,6 +351,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 +364,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.changeDirectory_(newPath); |
return true; |
}; |