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

Unified Diff: ui/file_manager/file_manager/common/js/metrics_events.js

Issue 1022423005: Move view change analytics tracking into DirectoryModel where implementation details can be hidden. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add FSP extension whitelist so we can report names to analytics rather than extension ids for provi… Created 5 years, 9 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: ui/file_manager/file_manager/common/js/metrics_events.js
diff --git a/ui/file_manager/file_manager/common/js/metrics_events.js b/ui/file_manager/file_manager/common/js/metrics_events.js
index 5b3bdbeb46b1cd54630af0825252de2608dcef5b..a25dc1e9b774593c1f407555dee1116c347e2b59 100644
--- a/ui/file_manager/file_manager/common/js/metrics_events.js
+++ b/ui/file_manager/file_manager/common/js/metrics_events.js
@@ -18,7 +18,8 @@ var metrics = metrics || metricsBase;
/** @enum {string} */
metrics.Categories = {
- ACQUISITION: 'Acquisition'
+ ACQUISITION: 'Acquisition',
+ INTERNALS: 'Internals'
};
/**
@@ -32,6 +33,32 @@ metrics.Dimension_ = {
};
/**
+ * Enumeration of known FSPs used to qualify "provided" extensions
+ * "screens" on analytics. All FSPs NOT present in this list
+ * will be reported to analytics as 'provided-unknown'.
+ *
+ * NOTE: When an unknown provider is encountered, a separate event will be
+ * sent to analytics with the id. Consulation of that event will provided
+ * an indication when an extension is popular enough to be added to the
+ * whitelist.
+ *
+ * @enum {string}
+ */
+metrics.FileSystemProviders = {
+ oedeeodfidgoollimchfdnbmhcpnklnd: 'ZipUnpacker'
+};
+
+/**
+ * Returns a new "screen" name for a provided file system type.
+ * @param {string|undefined} extensionId The FSP provider extension ID.
+ * @param {string} defaultName
+ * @return {string} Name or undefined if extension is unrecognized.
+ */
+metrics.getFileSystemProviderName = function(extensionId, defaultName) {
+ return metrics.FileSystemProviders[extensionId] || defaultName;
+};
+
+/**
* @enum {!analytics.EventBuilder.Dimension}
*/
metrics.Dimensions = {
@@ -70,12 +97,12 @@ metrics.event = metrics.event || {};
*/
metrics.event.Builders_ = {
IMPORT: analytics.EventBuilder.builder()
- .category(metrics.Categories.ACQUISITION)
+ .category(metrics.Categories.ACQUISITION),
+ INTERNALS: analytics.EventBuilder.builder()
+ .category(metrics.Categories.INTERNALS)
};
-/**
- * @enum {!analytics.EventBuilder}
- */
+/** @enum {!analytics.EventBuilder} */
metrics.ImportEvents = {
DEVICE_YANKED: metrics.event.Builders_.IMPORT
.action('Device Yanked'),
@@ -104,6 +131,12 @@ metrics.ImportEvents = {
.dimension(metrics.Dimensions.CONSUMER_TYPE_IMPORTER)
};
+/** @enum {!analytics.EventBuilder} */
+metrics.Internals = {
+ UNRECOGNIZED_FILE_SYSTEM_PROVIDER: metrics.event.Builders_.INTERNALS
+ .action('Unrecognized File System Provider')
+};
+
// namespace
metrics.timing = metrics.timing || {};

Powered by Google App Engine
This is Rietveld 408576698