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

Side by Side Diff: remoting/webapp/base/js/message_window_helper.js

Issue 1144593002: Revert of [Chromoting] Show any startup errors in the LoadingWindow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « remoting/webapp/base/js/message_window.js ('k') | remoting/webapp/base/js/typecheck.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 /** @suppress {duplicate} */ 7 /** @suppress {duplicate} */
8 var remoting = remoting || {}; 8 var remoting = remoting || {};
9 9
10 /** @constructor */ 10 /** @constructor */
(...skipping 23 matching lines...) Expand all
34 this.onTimeout = function() {}; 34 this.onTimeout = function() {};
35 35
36 /** @type {string} */ 36 /** @type {string} */
37 this.htmlFile = ''; 37 this.htmlFile = '';
38 38
39 /** @type {string} */ 39 /** @type {string} */
40 this.frame = ''; 40 this.frame = '';
41 41
42 /** @type {number} */ 42 /** @type {number} */
43 this.minimumWidth = 0; 43 this.minimumWidth = 0;
44
45 /** @type {boolean} */
46 this.showSpinner = false;
47 }; 44 };
48 45
49 /** 46 /**
50 * Create a new message window. 47 * Create a new message window.
51 * 48 *
52 * @param {remoting.MessageWindowOptions} options Message window create options 49 * @param {remoting.MessageWindowOptions} options Message window create options
53 * @constructor 50 * @constructor
54 */ 51 */
55 remoting.MessageWindow = function(options) { 52 remoting.MessageWindow = function(options) {
56 var title = options.title; 53 var title = options.title;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 * 144 *
148 * @param {string} message The message. 145 * @param {string} message The message.
149 */ 146 */
150 remoting.MessageWindow.prototype.updateMessage = function(message) { 147 remoting.MessageWindow.prototype.updateMessage = function(message) {
151 if (!this.window_) { 148 if (!this.window_) {
152 this.pendingWindowOperations_.push(this.updateMessage.bind(this, message)); 149 this.pendingWindowOperations_.push(this.updateMessage.bind(this, message));
153 return; 150 return;
154 } 151 }
155 152
156 var message_struct = { 153 var message_struct = {
157 command: 'update', 154 command: 'update_message',
158 message: message 155 message: message
159 }; 156 };
160 this.window_.postMessage(message_struct, '*'); 157 this.window_.postMessage(message_struct, '*');
161 }; 158 };
162
163 /**
164 * Update the message being shown in the window to the given error message.
165 * In addition to updating the message, any spinner is disabled and the
166 * button text is changed to 'OK'.
167 * This should only be called after the window has been shown.
168 *
169 * @param {string} message The message.
170 */
171 remoting.MessageWindow.prototype.updateErrorMessage = function(message) {
172 if (!this.window_) {
173 this.pendingWindowOperations_.push(this.updateMessage.bind(this, message));
174 return;
175 }
176
177 var message_struct = {
178 command: 'update',
179 message: message,
180 buttonLabel: chrome.i18n.getMessage(/*i18n-content*/'OK'),
181 cancelButtonLabel: '',
182 showSpinner: false
183 };
184 this.window_.postMessage(message_struct, '*');
185 };
186 159
187 /** 160 /**
188 * Close the message box and unregister it with the window manager. 161 * Close the message box and unregister it with the window manager.
189 */ 162 */
190 remoting.MessageWindow.prototype.close = function() { 163 remoting.MessageWindow.prototype.close = function() {
191 if (!this.window_) { 164 if (!this.window_) {
192 this.pendingWindowOperations_.push(this.close.bind(this)); 165 this.pendingWindowOperations_.push(this.close.bind(this));
193 return; 166 return;
194 } 167 }
195 168
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 270
298 /** 271 /**
299 * Cancel the current connection and close all app windows. 272 * Cancel the current connection and close all app windows.
300 * 273 *
301 * @param {number} result The dialog result. 274 * @param {number} result The dialog result.
302 */ 275 */
303 remoting.MessageWindow.quitApp = function(result) { 276 remoting.MessageWindow.quitApp = function(result) {
304 remoting.MessageWindowManager.closeAllMessageWindows(); 277 remoting.MessageWindowManager.closeAllMessageWindows();
305 window.close(); 278 window.close();
306 }; 279 };
OLDNEW
« no previous file with comments | « remoting/webapp/base/js/message_window.js ('k') | remoting/webapp/base/js/typecheck.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698