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

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

Issue 2628833002: Quick View UMA: export how quick view was opened. (Closed)
Patch Set: Rebase. Created 3 years, 11 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 | « ui/file_manager/file_manager/foreground/js/quick_view_controller.js ('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 66d7df66af711ccb0fd44a6fcafbe2ff586a8171..a56557e3f17a58d66c9fded1d3d80618e83d9493 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
@@ -25,6 +25,27 @@ function QuickViewUma(volumeManager, dialogType) {
}
/**
+ * In which way quick view was opened.
+ * @enum {string}
+ * @const
+ */
+QuickViewUma.WayToOpen = {
+ CONTEXT_MENU: 'contextMenu',
+ SPACE_KEY: 'spaceKey',
+};
+
+/**
+ * The order should be consistnet with the definition in histograms.xml.
+ *
+ * @const {!Array<QuickViewUma.WayToOpen>}
+ * @private
+ */
+QuickViewUma.WayToOpenValues_ = [
+ QuickViewUma.WayToOpen.CONTEXT_MENU,
+ QuickViewUma.WayToOpen.SPACE_KEY,
+];
+
+/**
* Keep the order of this in sync with FileManagerVolumeType in
* tools/metrics/histograms/histograms.xml.
*
@@ -69,9 +90,13 @@ QuickViewUma.prototype.onEntryChanged = function(entry) {
* Exports UMA based on the entry selected when Quick View is opened.
*
* @param {!FileEntry} entry
+ * @param {QuickViewUma.WayToOpen} wayToOpen
*/
-QuickViewUma.prototype.onOpened = function(entry) {
+QuickViewUma.prototype.onOpened = function(entry, wayToOpen) {
this.exportFileType_(entry, 'QuickView.FileTypeOnLaunch');
+ metrics.recordEnum(
+ 'QuickView.WayToOpen', wayToOpen, QuickViewUma.WayToOpenValues_);
+
var volumeType = this.volumeManager_.getVolumeInfo(entry).volumeType;
if (QuickViewUma.VolumeType.includes(volumeType)) {
metrics.recordEnum(
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/quick_view_controller.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698