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

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 debug code 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..fdc8711d5e3dd06290ea8ec2a622fd923ba27bdd 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} 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) {
xiyuan 2014/03/25 21:30:58 dynamic_backend -> dynamicBackend
vapier 2014/03/25 21:35:46 Done.
$('countBanner').textContent = loadTimeData.getStringF('crashCountFormat',
crashes.length);
@@ -24,6 +28,9 @@ function updateCrashList(enabled, crashes, version) {
$('enabledMode').hidden = !enabled;
$('disabledMode').hidden = enabled;
+ if (dynamic_backend)
+ $('crashUploadStatus').hidden = !enabled;
xiyuan 2014/03/25 21:30:58 nit: we can get rid "if" $('crashUploadStatus').
vapier 2014/03/25 21:35:46 sure. i plan on adding more UI elements, but they
+
if (!enabled)
return;
@@ -83,4 +90,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.
+ clearInterval(refreshCrashListId);
xiyuan 2014/03/25 21:30:58 if (refreshCrashListId) clearTimeout(refreshCras
vapier 2014/03/25 21:35:46 any particular reason for the if ? when i tested
+ 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