| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * Class handling creation and teardown of a remoting client session. | 7 * Class handling creation and teardown of a remoting client session. |
| 8 * | 8 * |
| 9 * The ClientSession class controls lifetime of the client plugin | 9 * The ClientSession class controls lifetime of the client plugin |
| 10 * object and provides the plugin with the functionality it needs to | 10 * object and provides the plugin with the functionality it needs to |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 style.marginLeft = adjustMargin(style.marginLeft, dx, | 1302 style.marginLeft = adjustMargin(style.marginLeft, dx, |
| 1303 window.innerWidth, plugin.clientWidth, stopX); | 1303 window.innerWidth, plugin.clientWidth, stopX); |
| 1304 | 1304 |
| 1305 var stopY = { stop: false }; | 1305 var stopY = { stop: false }; |
| 1306 style.marginTop = adjustMargin(style.marginTop, dy, | 1306 style.marginTop = adjustMargin(style.marginTop, dy, |
| 1307 window.innerHeight, plugin.clientHeight, stopY); | 1307 window.innerHeight, plugin.clientHeight, stopY); |
| 1308 return stopX.stop && stopY.stop; | 1308 return stopX.stop && stopY.stop; |
| 1309 }; | 1309 }; |
| 1310 | 1310 |
| 1311 remoting.ClientSession.prototype.resetScroll_ = function() { | 1311 remoting.ClientSession.prototype.resetScroll_ = function() { |
| 1312 var plugin = this.plugin_.element(); | 1312 if (this.plugin_) { |
| 1313 plugin.style.marginTop = '0px'; | 1313 var plugin = this.plugin_.element(); |
| 1314 plugin.style.marginLeft = '0px'; | 1314 plugin.style.marginTop = '0px'; |
| 1315 plugin.style.marginLeft = '0px'; |
| 1316 } |
| 1315 }; | 1317 }; |
| 1316 | 1318 |
| 1317 /** | 1319 /** |
| 1318 * Enable or disable bump-scrolling. When disabling bump scrolling, also reset | 1320 * Enable or disable bump-scrolling. When disabling bump scrolling, also reset |
| 1319 * the scroll offsets to (0, 0). | 1321 * the scroll offsets to (0, 0). |
| 1320 * @private | 1322 * @private |
| 1321 * @param {boolean} enable True to enable bump-scrolling, false to disable it. | 1323 * @param {boolean} enable True to enable bump-scrolling, false to disable it. |
| 1322 */ | 1324 */ |
| 1323 remoting.ClientSession.prototype.enableBumpScroll_ = function(enable) { | 1325 remoting.ClientSession.prototype.enableBumpScroll_ = function(enable) { |
| 1324 var element = /*@type{HTMLElement} */ document.documentElement; | 1326 var element = /*@type{HTMLElement} */ document.documentElement; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1431 * supported. | 1433 * supported. |
| 1432 * @private | 1434 * @private |
| 1433 */ | 1435 */ |
| 1434 remoting.ClientSession.prototype.createGnubbyAuthHandler_ = function() { | 1436 remoting.ClientSession.prototype.createGnubbyAuthHandler_ = function() { |
| 1435 if (this.mode_ == remoting.ClientSession.Mode.ME2ME) { | 1437 if (this.mode_ == remoting.ClientSession.Mode.ME2ME) { |
| 1436 this.gnubbyAuthHandler_ = new remoting.GnubbyAuthHandler(this); | 1438 this.gnubbyAuthHandler_ = new remoting.GnubbyAuthHandler(this); |
| 1437 // TODO(psj): Move to more generic capabilities mechanism. | 1439 // TODO(psj): Move to more generic capabilities mechanism. |
| 1438 this.sendGnubbyAuthMessage({'type': 'control', 'option': 'auth-v1'}); | 1440 this.sendGnubbyAuthMessage({'type': 'control', 'option': 'auth-v1'}); |
| 1439 } | 1441 } |
| 1440 }; | 1442 }; |
| OLD | NEW |