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

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: delete excess newline Created 6 years, 9 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
« no previous file with comments | « chrome/browser/resources/crashes.html ('k') | chrome/browser/ui/webui/crashes_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/crashes.js
diff --git a/chrome/browser/resources/crashes.js b/chrome/browser/resources/crashes.js
index c845c748f4f59de4bc31bd448a40a5da8022476d..83388f8a5ff88cae64149d81a5f12dde5d712ba8 100644
--- a/chrome/browser/resources/crashes.js
+++ b/chrome/browser/resources/crashes.js
@@ -2,6 +2,9 @@
// 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.
*/
@@ -12,10 +15,11 @@ function requestCrashes() {
/**
* Callback from backend with the list of crashes. Builds the UI.
* @param {boolean} enabled Whether or not crash reporting is enabled.
+ * @param {boolean} dynamicBackend 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, dynamicBackend, crashes, version) {
$('countBanner').textContent = loadTimeData.getStringF('crashCountFormat',
crashes.length);
@@ -23,6 +27,7 @@ function updateCrashList(enabled, crashes, version) {
$('enabledMode').hidden = !enabled;
$('disabledMode').hidden = enabled;
+ $('crashUploadStatus').hidden = !enabled || !dynamicBackend;
if (!enabled)
return;
@@ -83,4 +88,20 @@ function updateCrashList(enabled, crashes, version) {
$('noCrashes').hidden = crashes.length != 0;
}
-document.addEventListener('DOMContentLoaded', requestCrashes);
+/**
+ * Request crashes get uploaded in the background.
+ */
+function requestCrashUpload() {
+ // Don't need locking with this call because the system crash reporter
+ // has locking built into itself.
+ chrome.send('requestCrashUpload');
+
+ // Trigger a refresh in 5 seconds. Clear any previous requests.
+ clearTimeout(refreshCrashListId);
+ refreshCrashListId = setTimeout(requestCrashes, 5000);
+}
+
+document.addEventListener('DOMContentLoaded', function() {
+ $('uploadCrashes').onclick = requestCrashUpload;
+ requestCrashes();
+});
« no previous file with comments | « chrome/browser/resources/crashes.html ('k') | chrome/browser/ui/webui/crashes_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698