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

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

Issue 23463035: Use chrome.windows to open chrome://system from Feedback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698