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

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 7d6e6280dd5434d87a262d7eb0dde128c5fd722e..ada9f836ded55f8a47a181f66b0335c04900a8af 100644
--- a/chrome/browser/resources/file_manager/js/navigation_list.js
+++ b/chrome/browser/resources/file_manager/js/navigation_list.js
@@ -316,8 +316,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);
@@ -371,6 +373,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.
*/
@@ -383,9 +386,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;
};
« no previous file with comments | « chrome/browser/resources/file_manager/js/folder_shortcuts_data_model.js ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698