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

Side by Side Diff: chrome/browser/resources/sync_file_system_internals/task_log.js

Issue 2600683002: Run tools/clang-format-js on some of chrome/browser/resources/ (Closed)
Patch Set: hackhackhack Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var TaskLog = (function() { 5 var TaskLog = (function() {
6 'use strict'; 6 'use strict';
7 7
8 var nextTaskLogSeq = 1; 8 var nextTaskLogSeq = 1;
9 var TaskLog = {}; 9 var TaskLog = {};
10 10
11 function observeTaskLog() { 11 function observeTaskLog() {
12 chrome.send('observeTaskLog'); 12 chrome.send('observeTaskLog');
13 } 13 }
14 14
15 /** 15 /**
16 * Handles per-task log event. 16 * Handles per-task log event.
17 * @param {Object} taskLog a dictionary containing 'duration', 17 * @param {Object} taskLog a dictionary containing 'duration',
18 * 'task_description', 'result_description' and 'details'. 18 * 'task_description', 'result_description' and 'details'.
19 */ 19 */
20 TaskLog.onTaskLogRecorded = function(taskLog) { 20 TaskLog.onTaskLogRecorded = function(taskLog) {
21 var details = document.createElement('td'); 21 var details = document.createElement('td');
22 details.classList.add('task-log-details'); 22 details.classList.add('task-log-details');
23 23
24 var label = document.createElement('label'); 24 var label = document.createElement('label');
25 details.appendChild(label); 25 details.appendChild(label);
26 26
27 var collapseCheck = document.createElement('input'); 27 var collapseCheck = document.createElement('input');
28 collapseCheck.setAttribute('type', 'checkbox'); 28 collapseCheck.setAttribute('type', 'checkbox');
29 collapseCheck.classList.add('task-log-collapse-check'); 29 collapseCheck.classList.add('task-log-collapse-check');
30 label.appendChild(collapseCheck); 30 label.appendChild(collapseCheck);
31 31
32 var ul = document.createElement('ul'); 32 var ul = document.createElement('ul');
33 for (var i = 0; i < taskLog.details.length; ++i) 33 for (var i = 0; i < taskLog.details.length; ++i)
34 ul.appendChild(createElementFromText('li', taskLog.details[i])); 34 ul.appendChild(createElementFromText('li', taskLog.details[i]));
35 label.appendChild(ul); 35 label.appendChild(ul);
36 36
37 var tr = document.createElement('tr'); 37 var tr = document.createElement('tr');
38 tr.appendChild(createElementFromText( 38 tr.appendChild(createElementFromText(
39 'td', taskLog.duration, {'class': 'task-log-duration'})); 39 'td', taskLog.duration, {'class': 'task-log-duration'}));
40 tr.appendChild(createElementFromText( 40 tr.appendChild(createElementFromText(
41 'td', taskLog.task_description, {'class': 'task-log-description'})); 41 'td', taskLog.task_description, {'class': 'task-log-description'}));
42 tr.appendChild(createElementFromText( 42 tr.appendChild(createElementFromText(
43 'td', taskLog.result_description, {'class': 'task-log-result'})); 43 'td', taskLog.result_description, {'class': 'task-log-result'}));
44 tr.appendChild(details); 44 tr.appendChild(details);
45 45
46 $('task-log-entries').appendChild(tr); 46 $('task-log-entries').appendChild(tr);
47 } 47 };
48 48
49 /** 49 /**
50 * Get initial sync service values and set listeners to get updated values. 50 * Get initial sync service values and set listeners to get updated values.
51 */ 51 */
52 function main() { 52 function main() {
53 observeTaskLog(); 53 observeTaskLog();
54 } 54 }
55 55
56 document.addEventListener('DOMContentLoaded', main); 56 document.addEventListener('DOMContentLoaded', main);
57 return TaskLog; 57 return TaskLog;
58 })(); 58 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698