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

Unified Diff: remoting/webapp/base/js/message_window_helper.js

Issue 1139543002: [Chromoting] Show any startup errors in the LoadingWindow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge 'show' and 'update' window commands Created 5 years, 7 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: remoting/webapp/base/js/message_window_helper.js
diff --git a/remoting/webapp/base/js/message_window_helper.js b/remoting/webapp/base/js/message_window_helper.js
index 90267add4dc60a0b1e5e9df92a0d91d11d8361eb..71545620af6ad9fe0f38c24b12ac028726e95d01 100644
--- a/remoting/webapp/base/js/message_window_helper.js
+++ b/remoting/webapp/base/js/message_window_helper.js
@@ -38,6 +38,9 @@ remoting.MessageWindowOptions = function() {
/** @type {string} */
this.frame = '';
+
+ /** @type {boolean} */
+ this.showSpinner = false;
};
/**
@@ -148,13 +151,37 @@ remoting.MessageWindow.prototype.updateMessage = function(message) {
}
var message_struct = {
- command: 'update_message',
+ command: 'update',
message: message
};
this.window_.postMessage(message_struct, '*');
};
/**
+ * Update the message being shown in the window to the given error message.
+ * In addition to updating the message, any spinner is disabled and the
+ * button text is changed to 'OK'.
+ * This should only be called after the window has been shown.
+ *
+ * @param {string} message The message.
+ */
+remoting.MessageWindow.prototype.updateErrorMessage = function(message) {
+ if (!this.window_) {
+ this.pendingWindowOperations_.push(this.updateMessage.bind(this, message));
+ return;
+ }
+
+ var message_struct = {
+ command: 'update',
+ message: message,
+ buttonLabel: chrome.i18n.getMessage(/*i18n-content*/'OK'),
+ cancelButtonLabel: '',
+ showSpinner: false
+ };
+ this.window_.postMessage(message_struct, '*');
+};
+
+/**
* Close the message box and unregister it with the window manager.
*/
remoting.MessageWindow.prototype.close = function() {
« remoting/webapp/base/js/message_window.js ('K') | « remoting/webapp/base/js/message_window.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698