| OLD | NEW |
| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 logEntry['event']); | 69 logEntry['event']); |
| 70 res.appendChild(createTypeTag(type)); | 70 res.appendChild(createTypeTag(type)); |
| 71 res.appendChild(createLevelTag(level)); | 71 res.appendChild(createLevelTag(level)); |
| 72 res.appendChild(textWrapper); | 72 res.appendChild(textWrapper); |
| 73 return res; | 73 return res; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 /** | 76 /** |
| 77 * Creates event log entries. | 77 * Creates event log entries. |
| 78 * | 78 * |
| 79 * @param {Array.<string>} logEntries An array of strings that represent log | 79 * @param {Array<string>} logEntries An array of strings that represent log |
| 80 * log events in JSON format. | 80 * log events in JSON format. |
| 81 */ | 81 */ |
| 82 var createEventLog = function(logEntries) { | 82 var createEventLog = function(logEntries) { |
| 83 var container = $('log-container'); | 83 var container = $('log-container'); |
| 84 container.textContent = ''; | 84 container.textContent = ''; |
| 85 for (var i = 0; i < logEntries.length; ++i) { | 85 for (var i = 0; i < logEntries.length; ++i) { |
| 86 var entry = createLogEntryText(JSON.parse(logEntries[i])); | 86 var entry = createLogEntryText(JSON.parse(logEntries[i])); |
| 87 if (entry) | 87 if (entry) |
| 88 container.appendChild(entry); | 88 container.appendChild(entry); |
| 89 } | 89 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 checkboxes[i].onclick = requestLog; | 140 checkboxes[i].onclick = requestLog; |
| 141 | 141 |
| 142 setRefresh(); | 142 setRefresh(); |
| 143 requestLog(); | 143 requestLog(); |
| 144 }); | 144 }); |
| 145 | 145 |
| 146 return { | 146 return { |
| 147 getLogCallback: getLogCallback | 147 getLogCallback: getLogCallback |
| 148 }; | 148 }; |
| 149 })(); | 149 })(); |
| OLD | NEW |