Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3431)

Unified Diff: chrome/browser/resources/crashes.js

Issue 26536002: chrome://crashes: add a link on CrOS for triggering crash uploading (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698