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

Side by Side Diff: ui/file_manager/file_manager/foreground/js/quick_view_uma.js

Issue 2577123004: Export the dialog type where Quick View is opened. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/file_manager.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * UMA exporter for Quick View. 6 * UMA exporter for Quick View.
7 * 7 *
8 * @param {!VolumeManagerWrapper} volumeManager 8 * @param {!VolumeManagerWrapper} volumeManager
9 * @param {!DialogType} dialogType
9 * 10 *
10 * @constructor 11 * @constructor
11 */ 12 */
12 function QuickViewUma(volumeManager) { 13 function QuickViewUma(volumeManager, dialogType) {
13 14
14 /** 15 /**
15 * @type {!VolumeManagerWrapper} 16 * @type {!VolumeManagerWrapper}
16 * @private 17 * @private
17 */ 18 */
18 this.volumeManager_ = volumeManager; 19 this.volumeManager_ = volumeManager;
20 /**
21 * @type {DialogType}
22 * @private
23 */
24 this.dialogType_ = dialogType;
19 } 25 }
20 26
21 /** 27 /**
22 * Keep the order of this in sync with FileManagerVolumeType in 28 * Keep the order of this in sync with FileManagerVolumeType in
23 * tools/metrics/histograms/histograms.xml. 29 * tools/metrics/histograms/histograms.xml.
24 * 30 *
25 * @type {!Array<VolumeManagerCommon.VolumeType>} 31 * @type {!Array<VolumeManagerCommon.VolumeType>}
26 * @const 32 * @const
27 */ 33 */
28 QuickViewUma.VolumeType = [ 34 QuickViewUma.VolumeType = [
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 */ 72 */
67 QuickViewUma.prototype.onOpened = function(entry) { 73 QuickViewUma.prototype.onOpened = function(entry) {
68 this.exportFileType_(entry, 'QuickView.FileTypeOnLaunch'); 74 this.exportFileType_(entry, 'QuickView.FileTypeOnLaunch');
69 var volumeType = this.volumeManager_.getVolumeInfo(entry).volumeType; 75 var volumeType = this.volumeManager_.getVolumeInfo(entry).volumeType;
70 if (QuickViewUma.VolumeType.includes(volumeType)) { 76 if (QuickViewUma.VolumeType.includes(volumeType)) {
71 metrics.recordEnum( 77 metrics.recordEnum(
72 'QuickView.VolumeType', volumeType, QuickViewUma.VolumeType); 78 'QuickView.VolumeType', volumeType, QuickViewUma.VolumeType);
73 } else { 79 } else {
74 console.error('Unknown volume type: ' + volumeType); 80 console.error('Unknown volume type: ' + volumeType);
75 } 81 }
82 // Record stats of dialog types. It must be in sync with
83 // FileDialogType enum in tools/metrics/histograms/histogram.xml.
84 metrics.recordEnum('QuickView.DialogType', this.dialogType_,
85 [DialogType.SELECT_FOLDER,
86 DialogType.SELECT_UPLOAD_FOLDER,
87 DialogType.SELECT_SAVEAS_FILE,
88 DialogType.SELECT_OPEN_FILE,
89 DialogType.SELECT_OPEN_MULTI_FILE,
90 DialogType.FULL_PAGE]);
76 }; 91 };
OLDNEW
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/file_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698