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

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: Smaller diff. Created 5 years, 10 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 * 119 *
120 * @return {void} Nothing. 120 * @return {void} Nothing.
121 */ 121 */
122 remoting.Application.prototype.onDisconnected = function() { 122 remoting.Application.prototype.onDisconnected = function() {
123 this.delegate_.handleDisconnected(); 123 this.delegate_.handleDisconnected();
124 }; 124 };
125 125
126 /** 126 /**
127 * Called when the current session's connection has failed. 127 * Called when the current session's connection has failed.
128 * 128 *
129 * @param {remoting.Error} error 129 * @param {!remoting.Error} error
130 * @return {void} Nothing. 130 * @return {void} Nothing.
131 */ 131 */
132 remoting.Application.prototype.onConnectionFailed = function(error) { 132 remoting.Application.prototype.onConnectionFailed = function(error) {
133 this.delegate_.handleConnectionFailed(this.session_connector_, error); 133 this.delegate_.handleConnectionFailed(this.session_connector_, error);
134 }; 134 };
135 135
136 /** 136 /**
137 * Called when the current session has reached the point where the host has 137 * Called when the current session has reached the point where the host has
138 * started streaming video frames to the client. 138 * started streaming video frames to the client.
139 * 139 *
(...skipping 23 matching lines...) Expand all
163 163
164 if (remoting.clientSession) { 164 if (remoting.clientSession) {
165 return remoting.clientSession.handleExtensionMessage(type, message); 165 return remoting.clientSession.handleExtensionMessage(type, message);
166 } 166 }
167 return false; 167 return false;
168 }; 168 };
169 169
170 /** 170 /**
171 * Called when an error needs to be displayed to the user. 171 * Called when an error needs to be displayed to the user.
172 * 172 *
173 * @param {remoting.Error} errorTag The error to be localized and displayed. 173 * @param {!remoting.Error} errorTag The error to be localized and displayed.
174 * @return {void} Nothing. 174 * @return {void} Nothing.
175 */ 175 */
176 remoting.Application.prototype.onError = function(errorTag) { 176 remoting.Application.prototype.onError = function(errorTag) {
177 this.delegate_.handleError(errorTag); 177 this.delegate_.handleError(errorTag);
178 }; 178 };
179 179
180 /** 180 /**
181 * @return {remoting.SessionConnector} A session connector, creating a new one 181 * @return {remoting.SessionConnector} A session connector, creating a new one
182 * if necessary. 182 * if necessary.
183 */ 183 */
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 * Called when the current session has been disconnected. 234 * Called when the current session has been disconnected.
235 * 235 *
236 * @return {void} Nothing. 236 * @return {void} Nothing.
237 */ 237 */
238 remoting.Application.Delegate.prototype.handleDisconnected = function() {}; 238 remoting.Application.Delegate.prototype.handleDisconnected = function() {};
239 239
240 /** 240 /**
241 * Called when the current session's connection has failed. 241 * Called when the current session's connection has failed.
242 * 242 *
243 * @param {remoting.SessionConnector} connector 243 * @param {remoting.SessionConnector} connector
244 * @param {remoting.Error} error 244 * @param {!remoting.Error} error
245 * @return {void} Nothing. 245 * @return {void} Nothing.
246 */ 246 */
247 remoting.Application.Delegate.prototype.handleConnectionFailed = function( 247 remoting.Application.Delegate.prototype.handleConnectionFailed = function(
248 connector, error) {}; 248 connector, error) {};
249 249
250 /** 250 /**
251 * Called when the current session has reached the point where the host has 251 * Called when the current session has reached the point where the host has
252 * started streaming video frames to the client. 252 * started streaming video frames to the client.
253 * 253 *
254 * @return {void} Nothing. 254 * @return {void} Nothing.
255 */ 255 */
256 remoting.Application.Delegate.prototype.handleVideoStreamingStarted = function( 256 remoting.Application.Delegate.prototype.handleVideoStreamingStarted = function(
257 ) {}; 257 ) {};
258 258
259 /** 259 /**
260 * Called when an extension message needs to be handled. 260 * Called when an extension message needs to be handled.
261 * 261 *
262 * @param {string} type The type of the extension message. 262 * @param {string} type The type of the extension message.
263 * @param {Object} message The parsed extension message data. 263 * @param {Object} message The parsed extension message data.
264 * @return {boolean} Return true if the extension message was recognized. 264 * @return {boolean} Return true if the extension message was recognized.
265 */ 265 */
266 remoting.Application.Delegate.prototype.handleExtensionMessage = function( 266 remoting.Application.Delegate.prototype.handleExtensionMessage = function(
267 type, message) {}; 267 type, message) {};
268 268
269 /** 269 /**
270 * Called when an error needs to be displayed to the user. 270 * Called when an error needs to be displayed to the user.
271 * 271 *
272 * @param {remoting.Error} errorTag The error to be localized and displayed. 272 * @param {!remoting.Error} errorTag The error to be localized and displayed.
273 * @return {void} Nothing. 273 * @return {void} Nothing.
274 */ 274 */
275 remoting.Application.Delegate.prototype.handleError = function(errorTag) {}; 275 remoting.Application.Delegate.prototype.handleError = function(errorTag) {};
276 276
277 277
278 /** @type {remoting.Application} */ 278 /** @type {remoting.Application} */
279 remoting.app = null; 279 remoting.app = null;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698