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

Unified Diff: ui/file_manager/file_manager/foreground/js/quick_view_uma.js

Issue 2252723005: Add an UMA for file types selected when Quick View is launched. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/quick_view_uma.js
diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_uma.js b/ui/file_manager/file_manager/foreground/js/quick_view_uma.js
index 7f43d93e1597797d5ef898f7657dd09983461d26..c7b73fa629171eadb4e5ddf15b156d6128755b62 100644
--- a/ui/file_manager/file_manager/foreground/js/quick_view_uma.js
+++ b/ui/file_manager/file_manager/foreground/js/quick_view_uma.js
@@ -35,17 +35,28 @@ QuickViewUma.VolumeType = [
];
/**
- * Exports UMA based on the entry shown in Quick View.
+ * Exports file type metric with the given |name|.
*
* @param {!FileEntry} entry
+ * @param {string} name The histogram name.
+ *
+ * @private
*/
-QuickViewUma.prototype.onEntryChanged = function(entry) {
+QuickViewUma.prototype.exportFileType_ = function(entry, name) {
var extension = FileType.getExtension(entry).toLowerCase();
if (FileTasks.UMA_INDEX_KNOWN_EXTENSIONS.indexOf(extension) < 0) {
extension = 'other';
}
- metrics.recordEnum(
- 'QuickView.FileType', extension, FileTasks.UMA_INDEX_KNOWN_EXTENSIONS);
+ metrics.recordEnum(name, extension, FileTasks.UMA_INDEX_KNOWN_EXTENSIONS);
+};
+
+/**
+ * Exports UMA based on the entry shown in Quick View.
+ *
+ * @param {!FileEntry} entry
+ */
+QuickViewUma.prototype.onEntryChanged = function(entry) {
+ this.exportFileType_(entry, 'QuickView.FileType');
};
/**
@@ -54,6 +65,7 @@ QuickViewUma.prototype.onEntryChanged = function(entry) {
* @param {!FileEntry} entry
*/
QuickViewUma.prototype.onOpened = function(entry) {
+ this.exportFileType_(entry, 'QuickView.FileTypeOnLaunch');
var volumeType = this.volumeManager_.getVolumeInfo(entry).volumeType;
if (QuickViewUma.VolumeType.includes(volumeType)) {
metrics.recordEnum(
« no previous file with comments | « tools/metrics/histograms/histograms.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698