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 31704aefd7634658703b5247567499949c764002..e7b4dac579655fef5af0f644264fb5457331301e 100644 |
| --- a/chrome/browser/resources/feedback/js/feedback.js |
| +++ b/chrome/browser/resources/feedback/js/feedback.js |
| @@ -18,6 +18,8 @@ var lastReader = null; |
| var feedbackInfo = null; |
| var systemInfo = null; |
| +var systemInfoWindowId = 0; |
| + |
| /** |
| * Reads the selected file when the user selects a file. |
| * @param {Event} fileSelectedEvent The onChanged event for the file input box. |
| @@ -56,10 +58,17 @@ function clearAttachedFile() { |
| } |
| /** |
| - * Opens a new tab with chrome://system, showing the current system info. |
| + * Opens a new window with chrome://system, showing the current system info. |
| */ |
| -function openSystemTab() { |
| - window.open('chrome://system', '_blank'); |
| +function openSystemInfoWindow() { |
| + if (systemInfoWindowId == 0) { |
| + chrome.windows.create({url: 'chrome://system'}, function(win) { |
| + systemInfoWindowId = win.id; |
| + chrome.app.window.current().show(); |
|
xiyuan
2013/09/16 23:53:45
Is this necessary? Could you pass focused: true in
rkc
2013/09/17 00:00:00
Focused:true I believe is the default. Passing tha
|
| + }); |
| + } else { |
| + chrome.windows.update(systemInfoWindowId, {drawAttention: true}); |
| + } |
| } |
| /** |
| @@ -190,8 +199,13 @@ function initialize() { |
| $('send-report-button').onclick = sendReport; |
| $('cancel-button').onclick = cancel; |
| $('remove-attached-file').onclick = clearAttachedFile; |
| + |
| + chrome.windows.onRemoved.addListener(function(windowId, removeInfo) { |
| + if (windowId == systemInfoWindowId) |
| + systemInfoWindowId = 0; |
| + }); |
| if ($('sysinfo-url')) { |
| - $('sysinfo-url').onclick = openSystemTab; |
| + $('sysinfo-url').onclick = openSystemInfoWindow; |
| } |
| }); |
| } |