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

Unified Diff: chrome/browser/resources/user_actions/user_actions.js

Issue 11415063: Adds about:user-actions page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove extraneous comment Created 8 years, 1 month 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/user_actions/user_actions.js
diff --git a/chrome/browser/resources/user_actions/user_actions.js b/chrome/browser/resources/user_actions/user_actions.js
new file mode 100644
index 0000000000000000000000000000000000000000..17eef9ad932ff37a2059b2622ad4e0a5de827673
--- /dev/null
+++ b/chrome/browser/resources/user_actions/user_actions.js
@@ -0,0 +1,38 @@
+// Copyright 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.
+
+/**
+ * Javascript for user_actions.html, served from chrome://user-actions/
+ * This is used to debug user actons recording. It displays a live
arv (Not doing code reviews) 2012/11/21 15:09:08 s/acton/action/
arv (Not doing code reviews) 2012/11/21 15:09:08 Single space after .
Mark P 2012/11/21 16:05:45 Done.
Mark P 2012/11/21 16:05:45 Done.
+ * stream of all user action events that occur in chromium while the
+ * chrome://user-actions/ page is open.
+ *
+ * The simple object defined in this javascript file listens from
arv (Not doing code reviews) 2012/11/21 15:09:08 listens for
Mark P 2012/11/21 16:05:45 Done.
+ * callbacks from the C++ code saying that a new user action was seen.
+ */
+
+cr.define('userActions', function() {
+ 'user strict';
+
+ /**
+ * Appends a row to the output table listing the user action observed
+ * and the current timestamp.
+ * @param {string} userAction the name of the user action observed.
+ */
+ function observeUserAction(userAction) {
+ var table = $('user-actions-table');
+ var tr = document.createElement('tr');
+ var td = document.createElement('td');
+ td.textContent = userAction;
+ tr.appendChild(td);
+ td = document.createElement('td');
+ td.textContent = new Date().getTime() / 1000; // in seconds since epoch
arv (Not doing code reviews) 2012/11/21 15:09:08 Date.now()
Mark P 2012/11/21 16:05:45 Done.
+ tr.appendChild(td);
+ table.appendChild(tr);
+ }
+
+ return {
+ observeUserAction: observeUserAction
+ };
+});
« no previous file with comments | « chrome/browser/resources/user_actions/user_actions.html ('k') | chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698