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

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

Issue 1010053002: [Webapp Refactor] Implements remoting.ConnectionInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's feedback 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 remoting.Application.prototype.disconnect = function() { 108 remoting.Application.prototype.disconnect = function() {
109 if (remoting.clientSession) { 109 if (remoting.clientSession) {
110 remoting.clientSession.disconnect(remoting.Error.NONE); 110 remoting.clientSession.disconnect(remoting.Error.NONE);
111 console.log('Disconnected.'); 111 console.log('Disconnected.');
112 } 112 }
113 }; 113 };
114 114
115 /** 115 /**
116 * Called when a new session has been connected. 116 * Called when a new session has been connected.
117 * 117 *
118 * @param {remoting.ClientSession} clientSession 118 * @param {remoting.ConnectionInfo} connectionInfo
119 * @return {void} Nothing. 119 * @return {void} Nothing.
120 */ 120 */
121 remoting.Application.prototype.onConnected = function(clientSession) { 121 remoting.Application.prototype.onConnected = function(connectionInfo) {
122 this.sessionConnectedHooks_ = new base.Disposables( 122 this.sessionConnectedHooks_ = new base.Disposables(
123 new base.EventHook( 123 new base.EventHook(connectionInfo.session(), 'stateChanged',
124 clientSession, 'stateChanged', this.onClientStateChange_.bind(this)), 124 this.onClientStateChange_.bind(this)),
125 new base.RepeatingTimer(this.updateStatistics_.bind(this), 1000) 125 new base.RepeatingTimer(this.updateStatistics_.bind(this), 1000)
126 ); 126 );
127 remoting.clipboard.startSession(); 127 remoting.clipboard.startSession();
128 128
129 this.delegate_.handleConnected(clientSession); 129 this.delegate_.handleConnected(connectionInfo);
130 }; 130 };
131 131
132 /** 132 /**
133 * Called when the current session has been disconnected. 133 * Called when the current session has been disconnected.
134 * 134 *
135 * @return {void} Nothing. 135 * @return {void} Nothing.
136 */ 136 */
137 remoting.Application.prototype.onDisconnected = function() { 137 remoting.Application.prototype.onDisconnected = function() {
138 this.delegate_.handleDisconnected(); 138 this.delegate_.handleDisconnected();
139 }; 139 };
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 remoting.Application.Delegate.prototype.getApplicationName = function() {}; 293 remoting.Application.Delegate.prototype.getApplicationName = function() {};
294 294
295 /** 295 /**
296 * @return {string} The default remap keys for the current platform. 296 * @return {string} The default remap keys for the current platform.
297 */ 297 */
298 remoting.Application.Delegate.prototype.getDefaultRemapKeys = function() {}; 298 remoting.Application.Delegate.prototype.getDefaultRemapKeys = function() {};
299 299
300 /** 300 /**
301 * Called when a new session has been connected. 301 * Called when a new session has been connected.
302 * 302 *
303 * @param {remoting.ClientSession} clientSession 303 * @param {remoting.ConnectionInfo} connectionInfo
304 * @return {void} Nothing. 304 * @return {void} Nothing.
305 */ 305 */
306 remoting.Application.Delegate.prototype.handleConnected = function( 306 remoting.Application.Delegate.prototype.handleConnected = function(
307 clientSession) {}; 307 connectionInfo) {};
308 308
309 /** 309 /**
310 * Called when the current session has been disconnected. 310 * Called when the current session has been disconnected.
311 * 311 *
312 * @return {void} Nothing. 312 * @return {void} Nothing.
313 */ 313 */
314 remoting.Application.Delegate.prototype.handleDisconnected = function() {}; 314 remoting.Application.Delegate.prototype.handleDisconnected = function() {};
315 315
316 /** 316 /**
317 * Called when the current session's connection has failed. 317 * Called when the current session's connection has failed.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 * Perform any application-specific cleanup before exiting. This is called in 354 * Perform any application-specific cleanup before exiting. This is called in
355 * lieu of start() if the user declines the app permissions, and will usually 355 * lieu of start() if the user declines the app permissions, and will usually
356 * be called immediately prior to exiting, although delegates should not rely 356 * be called immediately prior to exiting, although delegates should not rely
357 * on this. 357 * on this.
358 */ 358 */
359 remoting.Application.Delegate.prototype.handleExit = function() {}; 359 remoting.Application.Delegate.prototype.handleExit = function() {};
360 360
361 361
362 /** @type {remoting.Application} */ 362 /** @type {remoting.Application} */
363 remoting.app = null; 363 remoting.app = null;
OLDNEW
« no previous file with comments | « remoting/webapp/app_remoting/js/app_remoting.js ('k') | remoting/webapp/crd/js/connection_info.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698