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

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

Issue 955283002: Converted remoting.Error from an enum to a class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Interface abstracting the Application functionality. 7 * Interface abstracting the Application functionality.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 * 137 *
138 * @return {void} Nothing. 138 * @return {void} Nothing.
139 */ 139 */
140 remoting.Application.prototype.onDisconnected = function() { 140 remoting.Application.prototype.onDisconnected = function() {
141 this.delegate_.handleDisconnected(); 141 this.delegate_.handleDisconnected();
142 }; 142 };
143 143
144 /** 144 /**
145 * Called when the current session's connection has failed. 145 * Called when the current session's connection has failed.
146 * 146 *
147 * @param {remoting.Error} error 147 * @param {!remoting.Error} error
148 * @return {void} Nothing. 148 * @return {void} Nothing.
149 */ 149 */
150 remoting.Application.prototype.onConnectionFailed = function(error) { 150 remoting.Application.prototype.onConnectionFailed = function(error) {
151 this.delegate_.handleConnectionFailed(this.session_connector_, error); 151 this.delegate_.handleConnectionFailed(this.session_connector_, error);
152 }; 152 };
153 153
154 /** 154 /**
155 * Called when the current session has reached the point where the host has 155 * Called when the current session has reached the point where the host has
156 * started streaming video frames to the client. 156 * started streaming video frames to the client.
157 * 157 *
(...skipping 23 matching lines...) Expand all
181 181
182 if (remoting.clientSession) { 182 if (remoting.clientSession) {
183 return remoting.clientSession.handleExtensionMessage(type, message); 183 return remoting.clientSession.handleExtensionMessage(type, message);
184 } 184 }
185 return false; 185 return false;
186 }; 186 };
187 187
188 /** 188 /**
189 * Called when an error needs to be displayed to the user. 189 * Called when an error needs to be displayed to the user.
190 * 190 *
191 * @param {remoting.Error} errorTag The error to be localized and displayed. 191 * @param {!remoting.Error} errorTag The error to be localized and displayed.
192 * @return {void} Nothing. 192 * @return {void} Nothing.
193 */ 193 */
194 remoting.Application.prototype.onError = function(errorTag) { 194 remoting.Application.prototype.onError = function(errorTag) {
195 this.delegate_.handleError(errorTag); 195 this.delegate_.handleError(errorTag);
196 }; 196 };
197 197
198 /** 198 /**
199 * @return {remoting.SessionConnector} A session connector, creating a new one 199 * @return {remoting.SessionConnector} A session connector, creating a new one
200 * if necessary. 200 * if necessary.
201 */ 201 */
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 * @param {string} token An OAuth access token. The delegate should not cache 277 * @param {string} token An OAuth access token. The delegate should not cache
278 * this token, but can assume that it will remain valid during application 278 * this token, but can assume that it will remain valid during application
279 * start-up. 279 * start-up.
280 */ 280 */
281 remoting.Application.Delegate.prototype.start = function(connector, token) {}; 281 remoting.Application.Delegate.prototype.start = function(connector, token) {};
282 282
283 /** 283 /**
284 * Report an authentication error to the user. This is called in lieu of start() 284 * Report an authentication error to the user. This is called in lieu of start()
285 * if the user cannot be authenticated or if they decline the app permissions. 285 * if the user cannot be authenticated or if they decline the app permissions.
286 * 286 *
287 * @param {remoting.Error} error The failure reason. 287 * @param {!remoting.Error} error The failure reason.
288 */ 288 */
289 remoting.Application.Delegate.prototype.signInFailed = function(error) {}; 289 remoting.Application.Delegate.prototype.signInFailed = function(error) {};
290 290
291 /** 291 /**
292 * @return {string} Application product name to be used in UI. 292 * @return {string} Application product name to be used in UI.
293 */ 293 */
294 remoting.Application.Delegate.prototype.getApplicationName = function() {}; 294 remoting.Application.Delegate.prototype.getApplicationName = function() {};
295 295
296 /** 296 /**
297 * @return {string} The default remap keys for the current platform. 297 * @return {string} The default remap keys for the current platform.
(...skipping 13 matching lines...) Expand all
311 * Called when the current session has been disconnected. 311 * Called when the current session has been disconnected.
312 * 312 *
313 * @return {void} Nothing. 313 * @return {void} Nothing.
314 */ 314 */
315 remoting.Application.Delegate.prototype.handleDisconnected = function() {}; 315 remoting.Application.Delegate.prototype.handleDisconnected = function() {};
316 316
317 /** 317 /**
318 * Called when the current session's connection has failed. 318 * Called when the current session's connection has failed.
319 * 319 *
320 * @param {remoting.SessionConnector} connector 320 * @param {remoting.SessionConnector} connector
321 * @param {remoting.Error} error 321 * @param {!remoting.Error} error
322 * @return {void} Nothing. 322 * @return {void} Nothing.
323 */ 323 */
324 remoting.Application.Delegate.prototype.handleConnectionFailed = 324 remoting.Application.Delegate.prototype.handleConnectionFailed =
325 function(connector, error) {}; 325 function(connector, error) {};
326 326
327 /** 327 /**
328 * Called when the current session has reached the point where the host has 328 * Called when the current session has reached the point where the host has
329 * started streaming video frames to the client. 329 * started streaming video frames to the client.
330 * 330 *
331 * @return {void} Nothing. 331 * @return {void} Nothing.
332 */ 332 */
333 remoting.Application.Delegate.prototype.handleVideoStreamingStarted = 333 remoting.Application.Delegate.prototype.handleVideoStreamingStarted =
334 function() {}; 334 function() {};
335 335
336 /** 336 /**
337 * Called when an extension message needs to be handled. 337 * Called when an extension message needs to be handled.
338 * 338 *
339 * @param {string} type The type of the extension message. 339 * @param {string} type The type of the extension message.
340 * @param {Object} message The parsed extension message data. 340 * @param {Object} message The parsed extension message data.
341 * @return {boolean} Return true if the extension message was recognized. 341 * @return {boolean} Return true if the extension message was recognized.
342 */ 342 */
343 remoting.Application.Delegate.prototype.handleExtensionMessage = 343 remoting.Application.Delegate.prototype.handleExtensionMessage =
344 function(type, message) {}; 344 function(type, message) {};
345 345
346 /** 346 /**
347 * Called when an error needs to be displayed to the user. 347 * Called when an error needs to be displayed to the user.
348 * 348 *
349 * @param {remoting.Error} errorTag The error to be localized and displayed. 349 * @param {!remoting.Error} errorTag The error to be localized and displayed.
350 * @return {void} Nothing. 350 * @return {void} Nothing.
351 */ 351 */
352 remoting.Application.Delegate.prototype.handleError = function(errorTag) {}; 352 remoting.Application.Delegate.prototype.handleError = function(errorTag) {};
353 353
354 354
355 /** @type {remoting.Application} */ 355 /** @type {remoting.Application} */
356 remoting.app = null; 356 remoting.app = null;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698