| Index: chrome/browser/resources/crashes.js
|
| diff --git a/chrome/browser/resources/crashes.js b/chrome/browser/resources/crashes.js
|
| index c845c748f4f59de4bc31bd448a40a5da8022476d..fdd594dfb41e49df7e13845afcf556a9659c28d2 100644
|
| --- a/chrome/browser/resources/crashes.js
|
| +++ b/chrome/browser/resources/crashes.js
|
| @@ -2,20 +2,25 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +/* Id for tracking automatic refresh of crash list. */
|
| +var refreshCrashListId = undefined;
|
| +
|
| /**
|
| * Requests the list of crashes from the backend.
|
| */
|
| function requestCrashes() {
|
| + refreshCrashListId = clearInterval(refreshCrashListId);
|
| chrome.send('requestCrashList');
|
| }
|
|
|
| /**
|
| * Callback from backend with the list of crashes. Builds the UI.
|
| * @param {boolean} enabled Whether or not crash reporting is enabled.
|
| + * @param {boolean} dynamic_backend Whether the crash backend is dynamic.
|
| * @param {array} crashes The list of crashes.
|
| * @param {string} version The browser version.
|
| */
|
| -function updateCrashList(enabled, crashes, version) {
|
| +function updateCrashList(enabled, dynamic_backend, crashes, version) {
|
| $('countBanner').textContent = loadTimeData.getStringF('crashCountFormat',
|
| crashes.length);
|
|
|
| @@ -24,6 +29,9 @@ function updateCrashList(enabled, crashes, version) {
|
| $('enabledMode').hidden = !enabled;
|
| $('disabledMode').hidden = enabled;
|
|
|
| + if (dynamic_backend)
|
| + $('crashUploadStatus').hidden = !enabled;
|
| +
|
| if (!enabled)
|
| return;
|
|
|
| @@ -83,4 +91,27 @@ function updateCrashList(enabled, crashes, version) {
|
| $('noCrashes').hidden = crashes.length != 0;
|
| }
|
|
|
| -document.addEventListener('DOMContentLoaded', requestCrashes);
|
| +/**
|
| + * Request crashes get uploaded in the background.
|
| + * @return {boolean} Always false to disable navigation to linked anchor.
|
| + */
|
| +function requestCrashUpload() {
|
| + chrome.send('requestCrashUpload');
|
| +
|
| + // Trigger a refresh in 5 seconds.
|
| + refreshCrashListId = setTimeout(requestCrashes, 5000);
|
| +
|
| + return false;
|
| +}
|
| +
|
| +/**
|
| + * Callback from backend when crash uploading has started.
|
| + * @param {boolean} enabled Whether or not crash reporting is enabled.
|
| + */
|
| +function updateCrashUploadStatus(enabled) {
|
| +}
|
| +
|
| +document.addEventListener('DOMContentLoaded', function() {
|
| + $('uploadCrashesLink').onclick = requestCrashUpload;
|
| + requestCrashes();
|
| +});
|
|
|