Chromium Code Reviews| 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 c7b73fa629171eadb4e5ddf15b156d6128755b62..296e61525fff5b57cf892f7df858b5aab5375930 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 |
| @@ -19,6 +19,27 @@ function QuickViewUma(volumeManager) { |
| } |
| /** |
| + * In which way quick view was opened. |
| + * @enum {!string} |
|
fukino
2017/01/12 03:46:01
nit: ! is redundant
oka
2017/01/12 04:14:02
Oops. Done.
|
| + * @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. |
| * |
| @@ -63,9 +84,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 |
|
fukino
2017/01/12 03:46:01
nit: We usually don't use ! for enum types.
|
| */ |
| -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( |