OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /* Id for tracking automatic refresh of crash list. */ | 5 /* Id for tracking automatic refresh of crash list. */ |
6 var refreshCrashListId = undefined; | 6 var refreshCrashListId = undefined; |
7 | 7 |
8 /** | 8 /** |
9 * Requests the list of crashes from the backend. | 9 * Requests the list of crashes from the backend. |
10 */ | 10 */ |
(...skipping 17 matching lines...) Expand all Loading... |
28 $('enabledMode').hidden = !enabled; | 28 $('enabledMode').hidden = !enabled; |
29 $('disabledMode').hidden = enabled; | 29 $('disabledMode').hidden = enabled; |
30 $('crashUploadStatus').hidden = !enabled || !dynamicBackend; | 30 $('crashUploadStatus').hidden = !enabled || !dynamicBackend; |
31 | 31 |
32 if (!enabled) | 32 if (!enabled) |
33 return; | 33 return; |
34 | 34 |
35 // Clear any previous list. | 35 // Clear any previous list. |
36 crashSection.textContent = ''; | 36 crashSection.textContent = ''; |
37 | 37 |
| 38 var productName = loadTimeData.getString('shortProductName'); |
| 39 |
38 for (var i = 0; i < crashes.length; i++) { | 40 for (var i = 0; i < crashes.length; i++) { |
39 var crash = crashes[i]; | 41 var crash = crashes[i]; |
| 42 if (crash['local_id'] == '') |
| 43 crash['local_id'] = productName; |
40 | 44 |
41 var crashBlock = document.createElement('div'); | 45 var crashBlock = document.createElement('div'); |
42 var title = document.createElement('h3'); | 46 var title = document.createElement('h3'); |
43 title.textContent = loadTimeData.getStringF('crashHeaderFormat', | 47 title.textContent = loadTimeData.getStringF('crashHeaderFormat', |
44 crash['id']); | 48 crash['id'], |
| 49 crash['local_id']); |
45 crashBlock.appendChild(title); | 50 crashBlock.appendChild(title); |
46 var date = document.createElement('p'); | 51 var date = document.createElement('p'); |
47 date.textContent = loadTimeData.getStringF('crashTimeFormat', | 52 date.textContent = loadTimeData.getStringF('crashTimeFormat', |
48 crash['time']); | 53 crash['time']); |
49 crashBlock.appendChild(date); | 54 crashBlock.appendChild(date); |
50 var linkBlock = document.createElement('p'); | 55 var linkBlock = document.createElement('p'); |
51 var link = document.createElement('a'); | 56 var link = document.createElement('a'); |
52 var commentLines = [ | 57 var commentLines = [ |
53 'Chrome Version: ' + version, | 58 'Chrome Version: ' + version, |
54 // TODO(tbreisacher): fill in the OS automatically? | 59 // TODO(tbreisacher): fill in the OS automatically? |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 103 |
99 // Trigger a refresh in 5 seconds. Clear any previous requests. | 104 // Trigger a refresh in 5 seconds. Clear any previous requests. |
100 clearTimeout(refreshCrashListId); | 105 clearTimeout(refreshCrashListId); |
101 refreshCrashListId = setTimeout(requestCrashes, 5000); | 106 refreshCrashListId = setTimeout(requestCrashes, 5000); |
102 } | 107 } |
103 | 108 |
104 document.addEventListener('DOMContentLoaded', function() { | 109 document.addEventListener('DOMContentLoaded', function() { |
105 $('uploadCrashes').onclick = requestCrashUpload; | 110 $('uploadCrashes').onclick = requestCrashUpload; |
106 requestCrashes(); | 111 requestCrashes(); |
107 }); | 112 }); |
OLD | NEW |