OLD | NEW |
---|---|
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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * This class implements the functionality that is specific to application | 7 * This class implements the functionality that is specific to application |
8 * remoting ("AppRemoting" or AR). | 8 * remoting ("AppRemoting" or AR). |
9 */ | 9 */ |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 // Initialize the context menus. | 84 // Initialize the context menus. |
85 if (remoting.platformIsChromeOS()) { | 85 if (remoting.platformIsChromeOS()) { |
86 var adapter = new remoting.ContextMenuChrome(); | 86 var adapter = new remoting.ContextMenuChrome(); |
87 } else { | 87 } else { |
88 var adapter = new remoting.ContextMenuDom( | 88 var adapter = new remoting.ContextMenuDom( |
89 document.getElementById('context-menu')); | 89 document.getElementById('context-menu')); |
90 } | 90 } |
91 this.contextMenu_ = new remoting.ApplicationContextMenu(adapter); | 91 this.contextMenu_ = new remoting.ApplicationContextMenu(adapter); |
92 this.keyboardLayoutsMenu_ = new remoting.KeyboardLayoutsMenu(adapter); | 92 this.keyboardLayoutsMenu_ = new remoting.KeyboardLayoutsMenu(adapter); |
93 this.windowActivationMenu_ = new remoting.WindowActivationMenu(adapter); | 93 this.windowActivationMenu_ = new remoting.WindowActivationMenu(adapter); |
94 | |
95 remoting.LoadingWindow.show(); | |
Jamie
2015/03/21 01:18:23
Showing this dialog in init() is not correct, as w
garykac
2015/03/23 23:25:33
Sounds good.
| |
96 }; | 94 }; |
97 | 95 |
98 /** | 96 /** |
99 * Start the application. Once start() is called, the delegate can assume that | 97 * Start the application. Once start() is called, the delegate can assume that |
100 * the user has consented to all permissions specified in the manifest. | 98 * the user has consented to all permissions specified in the manifest. |
101 * | 99 * |
102 * @param {remoting.SessionConnector} connector | 100 * @param {remoting.SessionConnector} connector |
103 * @param {string} token An OAuth access token. The delegate should not cache | 101 * @param {string} token An OAuth access token. The delegate should not cache |
104 * this token, but can assume that it will remain valid during application | 102 * this token, but can assume that it will remain valid during application |
105 * start-up. | 103 * start-up. |
106 */ | 104 */ |
107 remoting.AppRemoting.prototype.start = function(connector, token) { | 105 remoting.AppRemoting.prototype.start = function(connector, token) { |
106 remoting.LoadingWindow.show(); | |
107 | |
108 /** @type {remoting.AppRemoting} */ | 108 /** @type {remoting.AppRemoting} */ |
109 var that = this; | 109 var that = this; |
110 | 110 |
111 /** @param {XMLHttpRequest} xhr */ | 111 /** @param {XMLHttpRequest} xhr */ |
112 var parseAppHostResponse = function(xhr) { | 112 var parseAppHostResponse = function(xhr) { |
113 if (xhr.status == 200) { | 113 if (xhr.status == 200) { |
114 var response = /** @type {remoting.AppRemoting.AppHostResponse} */ | 114 var response = /** @type {remoting.AppRemoting.AppHostResponse} */ |
115 (base.jsonParseSafe(xhr.responseText)); | 115 (base.jsonParseSafe(xhr.responseText)); |
116 if (response && | 116 if (response && |
117 response.status && | 117 response.status && |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'), | 369 chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'), |
370 chrome.i18n.getMessage(error.getTag())); | 370 chrome.i18n.getMessage(error.getTag())); |
371 }; | 371 }; |
372 | 372 |
373 /** | 373 /** |
374 * Close the loading window before exiting. | 374 * Close the loading window before exiting. |
375 */ | 375 */ |
376 remoting.AppRemoting.prototype.handleExit = function() { | 376 remoting.AppRemoting.prototype.handleExit = function() { |
377 remoting.LoadingWindow.close(); | 377 remoting.LoadingWindow.close(); |
378 }; | 378 }; |
OLD | NEW |