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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 183 } |
184 } | 184 } |
185 }; | 185 }; |
186 | 186 |
187 /** @param {string} token */ | 187 /** @param {string} token */ |
188 var getAppHost = function(token) { | 188 var getAppHost = function(token) { |
189 remoting.xhr.start({ | 189 remoting.xhr.start({ |
190 method: 'POST', | 190 method: 'POST', |
191 url: that.runApplicationUrl(), | 191 url: that.runApplicationUrl(), |
192 onDone: parseAppHostResponse, | 192 onDone: parseAppHostResponse, |
193 oauthToken: token, | 193 oauthToken: token |
194 }); | 194 }); |
195 }; | 195 }; |
196 | 196 |
197 /** @param {remoting.Error} error */ | 197 /** @param {remoting.Error} error */ |
198 var onError = function(error) { | 198 var onError = function(error) { |
199 that.handleError(error); | 199 that.handleError(error); |
200 }; | 200 }; |
201 | 201 |
202 remoting.LoadingWindow.show(); | 202 remoting.LoadingWindow.show(); |
203 | 203 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 * @param {remoting.Error} errorTag The error to be localized and displayed. | 346 * @param {remoting.Error} errorTag The error to be localized and displayed. |
347 * @return {void} Nothing. | 347 * @return {void} Nothing. |
348 */ | 348 */ |
349 remoting.AppRemoting.prototype.handleError = function(errorTag) { | 349 remoting.AppRemoting.prototype.handleError = function(errorTag) { |
350 console.error('Connection failed: ' + errorTag); | 350 console.error('Connection failed: ' + errorTag); |
351 remoting.LoadingWindow.close(); | 351 remoting.LoadingWindow.close(); |
352 remoting.MessageWindow.showErrorMessage( | 352 remoting.MessageWindow.showErrorMessage( |
353 chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'), | 353 chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'), |
354 chrome.i18n.getMessage(/** @type {string} */ (errorTag))); | 354 chrome.i18n.getMessage(/** @type {string} */ (errorTag))); |
355 }; | 355 }; |
OLD | NEW |