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

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

Issue 10480002: Implements metrics for destination search. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/print_preview.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..bdeaf141efbb8ccad2760a4bd521f041b76a711f
--- /dev/null
+++ b/chrome/browser/resources/print_preview/metrics.js
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+cr.define('print_preview', function() {
+ 'use strict';
+
+ /**
+ * Object used to measure usage statistics.
+ * @constructor
+ */
+ function Metrics() {};
+
+ /**
+ * Enumeration of metrics buckets to record.
+ * @enum {number}
+ */
+ Metrics.Bucket = {
+ // Used when the print destination search widget is shown.
+ DESTINATION_SEARCH_SHOWN: 0,
+ // Used when the user selects a print destination.
+ DESTINATION_SELECTED: 1,
+ // Used when the print destination search widget is closed without selecting
+ // a print destination.
+ DESTINATION_SELECTION_CANCELED: 2,
+ // Used when the Google Cloud Print promotions is shown to the user.
+ CLOUDPRINT_PROMO_SHOWN: 3,
+ // Used when the user chooses to sign-in to their Google account.
+ SIGNIN_TRIGGERED: 4
+ };
+
+ Metrics.prototype = {
+ /**
+ * Increments the counter for a given bucket.
+ * @param {!print_preview.Metrics.Bucket} bucket Bucket to increment.
+ */
+ increment: function(bucket) {
+ chrome.send('reportDestinationEvent', bucket);
+ }
+ };
+
+ // Export
+ return {
+ Metrics: Metrics
+ };
+});
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/print_preview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698