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

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

Issue 55363003: Send compressed histograms with system logs when sending feedback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: attachment helper 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/feedback/js/feedback.js
diff --git a/chrome/browser/resources/feedback/js/feedback.js b/chrome/browser/resources/feedback/js/feedback.js
index ef2adc416302b33c0f50adc4c4a4efcb7f7c62fa..e832b95d0f33487c838d55b36ed290ac1f7b8378 100644
--- a/chrome/browser/resources/feedback/js/feedback.js
+++ b/chrome/browser/resources/feedback/js/feedback.js
@@ -19,6 +19,7 @@ var feedbackInfo = null;
var systemInfo = null;
var systemInfoWindowId = 0;
+var histogramsWindowId = 0;
/**
* Reads the selected file when the user selects a file.
@@ -72,6 +73,20 @@ function openSystemInfoWindow() {
}
/**
+ * Opens a new window with chrome://histograms, showing the histogram metrics.
+ */
+function openHistogramsWindow() {
rkc 2013/11/01 19:57:39 Move this code to a common function which both ope
michaelpg 2013/11/01 22:14:50 How about this, or is it too much?
rkc 2013/11/01 22:28:32 LG.
+ if (histogramsWindowId == 0) {
+ chrome.windows.create({url: 'chrome://histograms'}, function(win) {
+ histogramsWindowId = win.id;
+ chrome.app.window.current().show();
+ });
+ } else {
+ chrome.windows.update(histogramsWindowId, {drawAttention: true});
+ }
+}
+
+/**
* Opens a new window with chrome://slow_trace, downloading performance data.
*/
function openSlowTraceWindow() {
@@ -107,13 +122,15 @@ function sendReport() {
feedbackInfo.email = $('user-email-text').value;
var useSystemInfo = false;
+ var useHistograms = false;
// On ChromeOS, since we gather System info, check if the user has given his
// permission for us to send system info.
<if expr="pp_ifdef('chromeos')">
if ($('sys-info-checkbox') != null &&
$('sys-info-checkbox').checked &&
systemInfo != null) {
- useSystemInfo = true;
+ // Send histograms along with system info.
+ useSystemInfo = useHistograms = true;
}
if ($('performance-info-checkbox') == null ||
!($('performance-info-checkbox').checked)) {
@@ -140,6 +157,8 @@ function sendReport() {
}
}
+ feedbackInfo.sendHistograms = useHistograms;
rkc 2013/11/01 19:57:39 See my comment on the idl.
+
// If the user doesn't want to send the screenshot.
if (!$('screenshot-checkbox').checked)
feedbackInfo.screenshot = null;
@@ -260,6 +279,13 @@ function initialize() {
chrome.feedbackPrivate.getStrings(function(strings) {
loadTimeData.data = strings;
i18nTemplate.process(document, loadTimeData);
+
+ if ($('sys-info-url')) {
+ $('sys-info-url').onclick = openSystemInfoWindow;
+ }
+ if ($('histograms-url')) {
+ $('histograms-url').onclick = openHistogramsWindow;
+ }
});
}
});
@@ -283,10 +309,9 @@ function initialize() {
chrome.windows.onRemoved.addListener(function(windowId, removeInfo) {
if (windowId == systemInfoWindowId)
systemInfoWindowId = 0;
+ else if (windowId == histogramsWindowId)
+ histogramsWindowId = 0;
});
- if ($('sysinfo-url')) {
- $('sysinfo-url').onclick = openSystemInfoWindow;
- }
});
}

Powered by Google App Engine
This is Rietveld 408576698