Commit 0d869d70 authored by dpapad's avatar dpapad Committed by Commit Bot

MD Extensions: Port UMA metrics from previous UI.

Bug: 781439
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I2aff2f2096f6824ceffc05c2c94fcbf013166e5a
Reviewed-on: https://chromium-review.googlesource.com/816354Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarDave Schuyler <dschuyler@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523603}
parent 3cf91d8d
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
'<(EXTERNS_GYP):developer_private', '<(EXTERNS_GYP):developer_private',
'<(EXTERNS_GYP):metrics_private',
'item', 'item',
], ],
'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
...@@ -119,6 +120,7 @@ ...@@ -119,6 +120,7 @@
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(EXTERNS_GYP):developer_private', '<(EXTERNS_GYP):developer_private',
'<(EXTERNS_GYP):metrics_private',
'item_behavior', 'item_behavior',
], ],
'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
...@@ -207,6 +209,7 @@ ...@@ -207,6 +209,7 @@
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data',
'<(EXTERNS_GYP):developer_private', '<(EXTERNS_GYP):developer_private',
'<(EXTERNS_GYP):management', '<(EXTERNS_GYP):management',
'<(EXTERNS_GYP):metrics_private',
'error_page', 'error_page',
'item', 'item',
'load_error', 'load_error',
...@@ -239,6 +242,7 @@ ...@@ -239,6 +242,7 @@
'dependencies': [ 'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(EXTERNS_GYP):metrics_private',
'navigation_helper', 'navigation_helper',
], ],
'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
...@@ -247,6 +251,7 @@ ...@@ -247,6 +251,7 @@
'target_name': 'toolbar', 'target_name': 'toolbar',
'dependencies': [ 'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(EXTERNS_GYP):metrics_private',
], ],
'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'], 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
}, },
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<div id="no-items" class="empty-list-message" <div id="no-items" class="empty-list-message"
hidden$="[[!shouldShowEmptyItemsMessage_( hidden$="[[!shouldShowEmptyItemsMessage_(
apps.length, extensions.length)]]"> apps.length, extensions.length)]]">
<span>$i18nRaw{noExtensionsOrApps}</span> <span on-tap="onNoExtensionsTap_">$i18nRaw{noExtensionsOrApps}</span>
</div> </div>
<div id="no-search-results" class="empty-list-message" <div id="no-search-results" class="empty-list-message"
hidden$="[[!shouldShowEmptySearchMessage_( hidden$="[[!shouldShowEmptySearchMessage_(
......
...@@ -91,6 +91,12 @@ cr.define('extensions', function() { ...@@ -91,6 +91,12 @@ cr.define('extensions', function() {
this.shownAppsCount_ === 0 && this.shownExtensionsCount_ === 0; this.shownAppsCount_ === 0 && this.shownExtensionsCount_ === 0;
}, },
/** @private */
onNoExtensionsTap_: function(e) {
if (e.target.tagName == 'A')
chrome.metricsPrivate.recordUserAction('Options_GetMoreExtensions');
},
/** @private */ /** @private */
announceSearchResults_: function() { announceSearchResults_: function() {
if (this.computedFilter_) { if (this.computedFilter_) {
......
...@@ -25,6 +25,15 @@ cr.define('extensions', function() { ...@@ -25,6 +25,15 @@ cr.define('extensions', function() {
}, },
}, },
listeners: {
'view-enter-start': 'onViewEnter_',
},
/** @private */
onViewEnter_: function() {
chrome.metricsPrivate.recordUserAction('Options_ExtensionCommands');
},
/** /**
* @return {!Array<!chrome.developerPrivate.ExtensionInfo>} * @return {!Array<!chrome.developerPrivate.ExtensionInfo>}
* @private * @private
......
...@@ -247,6 +247,7 @@ cr.define('extensions', function() { ...@@ -247,6 +247,7 @@ cr.define('extensions', function() {
/** @override */ /** @override */
updateAllExtensions() { updateAllExtensions() {
chrome.developerPrivate.autoUpdate(); chrome.developerPrivate.autoUpdate();
chrome.metricsPrivate.recordUserAction('Options_UpdateExtensions');
} }
/** @override */ /** @override */
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<div> <div>
<div class="separator"></div> <div class="separator"></div>
<a class="section-item" id="more-extensions" target="_blank" <a class="section-item" id="more-extensions" target="_blank"
href="$i18n{getMoreExtensionsUrl}"> href="$i18n{getMoreExtensionsUrl}" on-tap="onMoreExtensionsTap_">
<span>$i18n{openChromeWebStore}</span> <span>$i18n{openChromeWebStore}</span>
<div class="cr-icon icon-external"></div> <div class="cr-icon icon-external"></div>
<paper-ripple></paper-ripple> <paper-ripple></paper-ripple>
......
...@@ -24,7 +24,12 @@ cr.define('extensions', function() { ...@@ -24,7 +24,12 @@ cr.define('extensions', function() {
e.preventDefault(); e.preventDefault();
extensions.navigation.navigateTo({page: e.target.dataset.path}); extensions.navigation.navigateTo({page: e.target.dataset.path});
this.fire('close-drawer'); this.fire('close-drawer');
} },
/** @private */
onMoreExtensionsTap_: function() {
chrome.metricsPrivate.recordUserAction('Options_GetMoreExtensions');
},
}); });
return {Sidebar: Sidebar}; return {Sidebar: Sidebar};
......
...@@ -69,6 +69,10 @@ cr.define('extensions', function() { ...@@ -69,6 +69,10 @@ cr.define('extensions', function() {
/** @suppress {suspiciousCode} */ drawer.offsetTop; /** @suppress {suspiciousCode} */ drawer.offsetTop;
} }
this.expanded_ = !this.expanded_; this.expanded_ = !this.expanded_;
chrome.metricsPrivate.recordUserAction(
'Options_ToggleDeveloperMode_' +
(this.expanded_ ? 'Enabled' : 'Disabled'));
}, },
/** @private */ /** @private */
...@@ -83,11 +87,13 @@ cr.define('extensions', function() { ...@@ -83,11 +87,13 @@ cr.define('extensions', function() {
this.delegate.loadUnpacked().catch(loadError => { this.delegate.loadUnpacked().catch(loadError => {
this.fire('load-error', loadError); this.fire('load-error', loadError);
}); });
chrome.metricsPrivate.recordUserAction('Options_LoadUnpackedExtension');
}, },
/** @private */ /** @private */
onPackTap_: function() { onPackTap_: function() {
this.fire('pack-tap'); this.fire('pack-tap');
chrome.metricsPrivate.recordUserAction('Options_PackExtension');
}, },
// <if expr="chromeos"> // <if expr="chromeos">
......
...@@ -18,6 +18,7 @@ var expected = [ ...@@ -18,6 +18,7 @@ var expected = [
'getVariableValue', 'getVariableValue',
'loadTimes', 'loadTimes',
'management', 'management',
'metricsPrivate',
'runtime', 'runtime',
'send', 'send',
'test', 'test',
......
...@@ -267,6 +267,7 @@ ...@@ -267,6 +267,7 @@
"contexts": ["webui"], "contexts": ["webui"],
"matches": [ "matches": [
"chrome://bookmarks/*", "chrome://bookmarks/*",
"chrome://extensions/*",
"chrome://settings/*" "chrome://settings/*"
] ]
}], }],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment