Chromium Code Reviews| 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; |
| - } |
| }); |
| } |