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

Side by Side Diff: chrome/browser/resources/device_log_ui/device_log_ui.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 DeviceLogUI = (function() { 5 var DeviceLogUI = (function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Creates a tag for the log level. 9 * Creates a tag for the log level.
10 * 10 *
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 var textWrapper = document.createElement('span'); 56 var textWrapper = document.createElement('span');
57 var fileinfo = ''; 57 var fileinfo = '';
58 if ($('log-fileinfo').checked) 58 if ($('log-fileinfo').checked)
59 fileinfo = logEntry['file']; 59 fileinfo = logEntry['file'];
60 var timestamp = ''; 60 var timestamp = '';
61 if ($('log-timedetail').checked) 61 if ($('log-timedetail').checked)
62 timestamp = logEntry['timestamp']; 62 timestamp = logEntry['timestamp'];
63 else 63 else
64 timestamp = logEntry['timestampshort']; 64 timestamp = logEntry['timestampshort'];
65 textWrapper.textContent = loadTimeData.getStringF( 65 textWrapper.textContent = loadTimeData.getStringF(
66 'logEntryFormat', 66 'logEntryFormat', timestamp, fileinfo, logEntry['event']);
67 timestamp,
68 fileinfo,
69 logEntry['event']);
70 res.appendChild(createTypeTag(type)); 67 res.appendChild(createTypeTag(type));
71 res.appendChild(createLevelTag(level)); 68 res.appendChild(createLevelTag(level));
72 res.appendChild(textWrapper); 69 res.appendChild(textWrapper);
73 return res; 70 return res;
74 }; 71 };
75 72
76 /** 73 /**
77 * Creates event log entries. 74 * Creates event log entries.
78 * 75 *
79 * @param {Array<string>} logEntries An array of strings that represent log 76 * @param {Array<string>} logEntries An array of strings that represent log
(...skipping 10 matching lines...) Expand all
90 }; 87 };
91 88
92 /** 89 /**
93 * Callback function, triggered when the log is received. 90 * Callback function, triggered when the log is received.
94 * 91 *
95 * @param {Object} data A JSON structure of event log entries. 92 * @param {Object} data A JSON structure of event log entries.
96 */ 93 */
97 var getLogCallback = function(data) { 94 var getLogCallback = function(data) {
98 try { 95 try {
99 createEventLog(JSON.parse(data)); 96 createEventLog(JSON.parse(data));
100 } catch(e) { 97 } catch (e) {
101 var container = $('log-container'); 98 var container = $('log-container');
102 container.textContent = 'No log entries'; 99 container.textContent = 'No log entries';
103 } 100 }
104 }; 101 };
105 102
106 /** 103 /**
107 * Requests a log update. 104 * Requests a log update.
108 */ 105 */
109 var requestLog = function() { 106 var requestLog = function() {
110 chrome.send('DeviceLog.getLog'); 107 chrome.send('DeviceLog.getLog');
(...skipping 30 matching lines...) Expand all
141 $('log-refresh').onclick = requestLog; 138 $('log-refresh').onclick = requestLog;
142 checkboxes = document.querySelectorAll( 139 checkboxes = document.querySelectorAll(
143 '#log-checkbox-container input[type="checkbox"]'); 140 '#log-checkbox-container input[type="checkbox"]');
144 for (var i = 0; i < checkboxes.length; ++i) 141 for (var i = 0; i < checkboxes.length; ++i)
145 checkboxes[i].onclick = requestLog; 142 checkboxes[i].onclick = requestLog;
146 143
147 setRefresh(); 144 setRefresh();
148 requestLog(); 145 requestLog();
149 }); 146 });
150 147
151 return { 148 return {getLogCallback: getLogCallback};
152 getLogCallback: getLogCallback
153 };
154 })(); 149 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698