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

Unified Diff: chrome/browser/resources/print_preview/settings/more_settings.js

Issue 601573002: Add UMA stats for new Print Preview UI elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add INVITATION_AVAILABLE UMA stat. Created 6 years, 3 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: chrome/browser/resources/print_preview/settings/more_settings.js
diff --git a/chrome/browser/resources/print_preview/settings/more_settings.js b/chrome/browser/resources/print_preview/settings/more_settings.js
index 7f924eeb2b0811aad675ec70c00176f51151a46d..8a3d5f6fd2f6f490a9a84c8b35b628a636f04870 100644
--- a/chrome/browser/resources/print_preview/settings/more_settings.js
+++ b/chrome/browser/resources/print_preview/settings/more_settings.js
@@ -31,6 +31,12 @@ cr.define('print_preview', function() {
/** @private {boolean} */
this.firstDestinationReady_ = false;
+
+ /**
+ * Used to record usage statistics.
+ * @private {!print_preview.PrintSettingsUiMetricsContext}
+ */
+ this.metrics_ = new print_preview.PrintSettingsUiMetricsContext();
};
/**
@@ -45,6 +51,11 @@ cr.define('print_preview', function() {
MoreSettings.prototype = {
__proto__: print_preview.Component.prototype,
+ /** @return {boolean} Returns {@code true} if settings are expanded. */
+ get isExpanded() {
+ return this.settingsToShow_ == MoreSettings.SettingsToShow.ALL;
+ },
+
/** @override */
enterDocument: function() {
print_preview.Component.prototype.enterDocument.call(this);
@@ -80,6 +91,9 @@ cr.define('print_preview', function() {
MoreSettings.SettingsToShow.ALL :
MoreSettings.SettingsToShow.MOST_POPULAR;
this.updateState_(false);
+ this.metrics_.record(this.isExpanded ?
+ print_preview.Metrics.PrintSettingsUiBucket.MORE_SETTINGS_CLICKED :
+ print_preview.Metrics.PrintSettingsUiBucket.LESS_SETTINGS_CLICKED);
},
/**

Powered by Google App Engine
This is Rietveld 408576698