Index: chrome/browser/resources/crashes.js |
diff --git a/chrome/browser/resources/crashes.js b/chrome/browser/resources/crashes.js |
index c845c748f4f59de4bc31bd448a40a5da8022476d..27cfbd9009977672d7ce8372ff21348b3cccd428 100644 |
--- a/chrome/browser/resources/crashes.js |
+++ b/chrome/browser/resources/crashes.js |
@@ -2,10 +2,14 @@ |
// 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'); |
} |
@@ -83,4 +87,26 @@ function updateCrashList(enabled, crashes, version) { |
$('noCrashes').hidden = crashes.length != 0; |
} |
+/** |
+ * Request crashes get uploaded in the background. |
+ */ |
+function requestCrashUpload() { |
+ chrome.send('requestCrashUpload'); |
+ |
+ // Trigger a refresh in 5 seconds. |
+ refreshCrashListId = setInterval(requestCrashes, 5000); |
+} |
+ |
+/** |
+ * Callback from backend when crash uploading has started. |
+ * @param {boolean} enabled Whether or not crash reporting is enabled. |
+ */ |
+function updateCrashUploadStatus(enabled) { |
+ $('uploadCrashesLink').onclick = requestCrashUpload; |
+ $('crashUploadStatus').hidden = !enabled; |
+ |
+ if (!enabled) |
Lei Zhang
2013/10/08 18:05:07
Don't you return no matter what?
vapier
2013/10/08 18:10:16
yes. this makes more sense when you see a follow
|
+ return; |
+} |
+ |
document.addEventListener('DOMContentLoaded', requestCrashes); |