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

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

Issue 1780553002: Fix Starting the feedback app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « ash/accelerators/accelerator_table.cc ('k') | chrome/browser/resources/feedback/js/feedback.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/feedback/js/event_handler.js
diff --git a/chrome/browser/resources/feedback/js/event_handler.js b/chrome/browser/resources/feedback/js/event_handler.js
index ebc426df214fc6a9027eb40a6f46d213a8c8849f..4ca6d128807197b2b7c69c726da565aa3a5e513c 100644
--- a/chrome/browser/resources/feedback/js/event_handler.js
+++ b/chrome/browser/resources/feedback/js/event_handler.js
@@ -200,14 +200,6 @@ function onSysInfoReadyForSend(sysInfo) {
* @param {Object} feedbackInfo Object containing any initial feedback info.
*/
function startFeedbackUI(feedbackInfo) {
- initialFeedbackInfo = feedbackInfo;
- finalFeedbackInfo = null;
- systemInfo = null;
- isSystemInfoReady = false;
- onSystemInfoReadyCallback = null;
-
- chrome.feedbackPrivate.getSystemInformation(getSystemInformationCallback);
-
var win = chrome.app.window.get(FEEDBACK_DEFAULT_WINDOW_ID);
if (win) {
win.show();
@@ -221,13 +213,27 @@ function startFeedbackUI(feedbackInfo) {
hidden: true,
resizable: false },
function(appWindow) {
+ // Initialize the state of the app only once upon the creation of the
+ // feedback UI window.
+ initialFeedbackInfo = feedbackInfo;
+ finalFeedbackInfo = null;
+ systemInfo = null;
+ isSystemInfoReady = false;
+ onSystemInfoReadyCallback = null;
+
// Define some functions for the new window so that it can call back
// into here.
// Define a function for the new window to get the system information.
- // Returns null if the system information is not ready yet.
- appWindow.contentWindow.getSystemInformation = function() {
- return systemInfo;
+ appWindow.contentWindow.getSystemInformation = function(callback) {
+ if (!isSystemInfoReady) {
+ onSystemInfoReadyCallback = callback;
+ chrome.feedbackPrivate.getSystemInformation(
+ getSystemInformationCallback);
+ return;
+ }
+
+ callback(systemInfo);
};
// Define a function to be called by the new window when the report is
@@ -247,13 +253,6 @@ function startFeedbackUI(feedbackInfo) {
appWindow.contentWindow.isSystemInfoReady = function() {
return isSystemInfoReady;
};
-
- // Registers a callback that will be invoked when the system information
- // is received.
- appWindow.contentWindow.setOnSystemInfoReadyCallback =
- function(callback) {
- onSystemInfoReadyCallback = callback;
- };
});
}
« no previous file with comments | « ash/accelerators/accelerator_table.cc ('k') | chrome/browser/resources/feedback/js/feedback.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698