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

Unified Diff: chrome/browser/resources/print_preview/metrics.js

Issue 11194020: Creates GCP promo for ChromeOS users with no cloud printers. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge with trunk. Created 8 years, 2 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/metrics.js
diff --git a/chrome/browser/resources/print_preview/metrics.js b/chrome/browser/resources/print_preview/metrics.js
index d88be2012356dbb4c97a928c33c97725c7bc4c89..f298de6388b12826df849fe6fd71977c4af37978 100644
--- a/chrome/browser/resources/print_preview/metrics.js
+++ b/chrome/browser/resources/print_preview/metrics.js
@@ -19,7 +19,8 @@ cr.define('print_preview', function() {
* @enum {number}
*/
Metrics.BucketGroup = {
- DESTINATION_SEARCH: 0
+ DESTINATION_SEARCH: 0,
+ GCP_PROMO: 1
};
/**
@@ -43,6 +44,23 @@ cr.define('print_preview', function() {
};
/**
+ * Enumeration of buckets that a user can enter while using the Google Cloud
+ * Print promotion.
+ * @enum {number}
+ */
+ Metrics.GcpPromoBucket = {
+ // Used when the Google Cloud Print pomotion (shown above the pdf preview
+ // plugin) is shown to the user.
+ SHOWN: 0,
+ // Used when the user clicks the "Get started" link in the promotion shown
+ // in CLOUDPRINT_BIG_PROMO_SHOWN.
+ CLICKED: 1,
+ // Used when the user dismisses the promotion shown in
+ // CLOUDPRINT_BIG_PROMO_SHOWN.
+ DISMISSED: 2
+ };
+
+ /**
* Name of the C++ function to call to increment bucket counts.
* @type {string}
* @const
@@ -58,6 +76,15 @@ cr.define('print_preview', function() {
incrementDestinationSearchBucket: function(bucket) {
chrome.send(Metrics.NATIVE_FUNCTION_NAME_,
[Metrics.BucketGroup.DESTINATION_SEARCH, bucket]);
+ },
+
+ /**
+ * Increments the counter of a gcp-promo bucket.
+ * @param {!Metrics.GcpPromoBucket} bucket Bucket to increment.
+ */
+ incrementGcpPromoBucket: function(bucket) {
+ chrome.send(Metrics.NATIVE_FUNCTION_NAME_,
+ [Metrics.BucketGroup.GCP_PROMO, bucket]);
}
};

Powered by Google App Engine
This is Rietveld 408576698