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

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: rebase 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 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;
};

Powered by Google App Engine
This is Rietveld 408576698