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

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..83944e501788b47aa1861b13878374a0c2ea0b8a 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,23 @@ 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);
xiyuan 2013/10/08 20:20:10 Since requestCrashes clears the interval, it seems
vapier 2014/03/25 20:49:07 Done
+}
+
+/**
+ * Callback from backend when crash uploading has started.
+ * @param {boolean} enabled Whether or not crash reporting is enabled.
+ */
+function updateCrashUploadStatus(enabled) {
+ $('uploadCrashesLink').onclick = requestCrashUpload;
Lei Zhang 2013/10/08 20:08:57 Can't you just set this once and be done with it?
vapier 2013/10/08 20:16:24 i can add logic to initialize only once
+ $('crashUploadStatus').hidden = !enabled;
+}
+
document.addEventListener('DOMContentLoaded', requestCrashes);

Powered by Google App Engine
This is Rietveld 408576698