| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 /** | 5 /** |
| 6 * Requests the list of uploads from the backend. | 6 * Requests the list of uploads from the backend. |
| 7 */ | 7 */ |
| 8 function requestUploads() { | 8 function requestUploads() { |
| 9 chrome.send('requestWebRtcLogsList'); | 9 chrome.send('requestWebRtcLogsList'); |
| 10 } | 10 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 logSection.textContent = ''; | 24 logSection.textContent = ''; |
| 25 | 25 |
| 26 for (var i = 0; i < uploads.length; i++) { | 26 for (var i = 0; i < uploads.length; i++) { |
| 27 var upload = uploads[i]; | 27 var upload = uploads[i]; |
| 28 | 28 |
| 29 var logBlock = document.createElement('div'); | 29 var logBlock = document.createElement('div'); |
| 30 | 30 |
| 31 var title = document.createElement('h3'); | 31 var title = document.createElement('h3'); |
| 32 title.textContent = | 32 title.textContent = |
| 33 loadTimeData.getStringF('webrtcLogHeaderFormat', | 33 loadTimeData.getStringF('webrtcLogHeaderFormat', |
| 34 upload['capture_time'].length != 0 ? | 34 upload['capture_time']); |
| 35 upload['capture_time'] : | |
| 36 upload['upload_time']); | |
| 37 logBlock.appendChild(title); | 35 logBlock.appendChild(title); |
| 38 | 36 |
| 39 var localFileLine = document.createElement('p'); | 37 var localFileLine = document.createElement('p'); |
| 40 if (upload['local_file'].length == 0) { | 38 if (upload['local_file'].length == 0) { |
| 41 localFileLine.textContent = | 39 localFileLine.textContent = |
| 42 loadTimeData.getString('noLocalLogFileMessage'); | 40 loadTimeData.getString('noLocalLogFileMessage'); |
| 43 } else { | 41 } else { |
| 44 localFileLine.textContent = | 42 localFileLine.textContent = |
| 45 loadTimeData.getString('webrtcLogLocalFileLabelFormat') + ' '; | 43 loadTimeData.getString('webrtcLogLocalFileLabelFormat') + ' '; |
| 46 var localFileLink = document.createElement('a'); | 44 var localFileLink = document.createElement('a'); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 94 } |
| 97 logBlock.appendChild(uploadLine); | 95 logBlock.appendChild(uploadLine); |
| 98 | 96 |
| 99 logSection.appendChild(logBlock); | 97 logSection.appendChild(logBlock); |
| 100 } | 98 } |
| 101 | 99 |
| 102 $('no-logs').hidden = uploads.length != 0; | 100 $('no-logs').hidden = uploads.length != 0; |
| 103 } | 101 } |
| 104 | 102 |
| 105 document.addEventListener('DOMContentLoaded', requestUploads); | 103 document.addEventListener('DOMContentLoaded', requestUploads); |
| OLD | NEW |