Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * Javascript for user_actions.html, served from chrome://user-actions/ | |
| 7 * 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.
| |
| 8 * stream of all user action events that occur in chromium while the | |
| 9 * chrome://user-actions/ page is open. | |
| 10 * | |
| 11 * 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.
| |
| 12 * callbacks from the C++ code saying that a new user action was seen. | |
| 13 */ | |
| 14 | |
| 15 cr.define('userActions', function() { | |
| 16 'user strict'; | |
| 17 | |
| 18 /** | |
| 19 * Appends a row to the output table listing the user action observed | |
| 20 * and the current timestamp. | |
| 21 * @param {string} userAction the name of the user action observed. | |
| 22 */ | |
| 23 function observeUserAction(userAction) { | |
| 24 var table = $('user-actions-table'); | |
| 25 var tr = document.createElement('tr'); | |
| 26 var td = document.createElement('td'); | |
| 27 td.textContent = userAction; | |
| 28 tr.appendChild(td); | |
| 29 td = document.createElement('td'); | |
| 30 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.
| |
| 31 tr.appendChild(td); | |
| 32 table.appendChild(tr); | |
| 33 } | |
| 34 | |
| 35 return { | |
| 36 observeUserAction: observeUserAction | |
| 37 }; | |
| 38 }); | |
| OLD | NEW |