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
3 // found in the LICENSE file.
6 * Requests the list of uploads from the backend.
8 function requestUploads() {
9 chrome.send('requestWebRtcLogsList');
13 * Callback from backend with the list of uploads. Builds the UI.
14 * @param {array} uploads The list of uploads.
15 * @param {string} version The browser version.
17 function updateWebRtcLogsList(uploads, version) {
18 $('log-banner').textContent = loadTimeData.getStringF('webrtcLogCountFormat',
21 var logSection = $('log-list');
23 // Clear any previous list.
24 logSection.textContent = '';
26 for (var i = 0; i < uploads.length; i++) {
27 var upload = uploads[i];
29 var logBlock = document.createElement('div');
30 var title = document.createElement('h3');
31 title.textContent = loadTimeData.getStringF('webrtcLogHeaderFormat',
33 logBlock.appendChild(title);
34 var date = document.createElement('p');
35 date.textContent = loadTimeData.getStringF('webrtcLogTimeFormat',
37 logBlock.appendChild(date);
38 var linkBlock = document.createElement('p');
39 var link = document.createElement('a');
41 'Chrome Version: ' + version,
42 // TODO(tbreisacher): fill in the OS automatically?
43 'Operating System: e.g., "Windows 7", "Mac OSX 10.6"',
45 'URL (if applicable) where the problem occurred:',
47 'Can you reproduce this problem?',
49 'What steps will reproduce this problem? (or if it\'s not ' +
50 'reproducible, what were you doing just before the problem)?',
54 '*Please note that issues filed with no information filled in ' +
55 'above will be marked as WontFix*',
57 '****DO NOT CHANGE BELOW THIS LINE****',
58 'report_id:' + upload.id
61 template: 'Defect report from user',
62 comment: commentLines.join('\n'),
64 var href = 'http://code.google.com/p/chromium/issues/entry';
65 for (var param in params) {
66 href = appendParam(href, param, params[param]);
69 link.target = '_blank';
70 link.textContent = loadTimeData.getString('bugLinkText');
71 linkBlock.appendChild(link);
72 logBlock.appendChild(linkBlock);
73 logSection.appendChild(logBlock);
76 $('no-logs').hidden = uploads.length != 0;
79 document.addEventListener('DOMContentLoaded', requestUploads);