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 * Functions related to the 'client screen' for Chromoting. | 7 * Functions related to the 'client screen' for Chromoting. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 */ | 80 */ |
81 remoting.cancelConnect = function() { | 81 remoting.cancelConnect = function() { |
82 if (remoting.supportHostsXhr_) { | 82 if (remoting.supportHostsXhr_) { |
83 remoting.supportHostsXhr_.abort(); | 83 remoting.supportHostsXhr_.abort(); |
84 remoting.supportHostsXhr_ = null; | 84 remoting.supportHostsXhr_ = null; |
85 } | 85 } |
86 if (remoting.clientSession) { | 86 if (remoting.clientSession) { |
87 remoting.clientSession.removePlugin(); | 87 remoting.clientSession.removePlugin(); |
88 remoting.clientSession = null; | 88 remoting.clientSession = null; |
89 } | 89 } |
90 remoting.setMode(remoting.AppMode.HOME); | 90 if (remoting.currentConnectionType == remoting.ConnectionType.Me2Me) { |
91 document.getElementById('access-code-entry').value = ''; | 91 remoting.initDaemonUi(); |
| 92 } else { |
| 93 remoting.setMode(remoting.AppMode.HOME); |
| 94 document.getElementById('access-code-entry').value = ''; |
| 95 } |
92 }; | 96 }; |
93 | 97 |
94 /** | 98 /** |
95 * Toggle the scale-to-fit feature for the current client session. | 99 * Toggle the scale-to-fit feature for the current client session. |
96 * | 100 * |
97 * @return {void} Nothing. | 101 * @return {void} Nothing. |
98 */ | 102 */ |
99 remoting.toggleScaleToFit = function() { | 103 remoting.toggleScaleToFit = function() { |
100 remoting.setScaleToFit(!remoting.clientSession.getScaleToFit()); | 104 remoting.setScaleToFit(!remoting.clientSession.getScaleToFit()); |
101 }; | 105 }; |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 /** @type {string} */ (remoting.oauth2.getCachedEmail()), | 509 /** @type {string} */ (remoting.oauth2.getCachedEmail()), |
506 remoting.ClientSession.Mode.ME2ME, onClientStateChange_); | 510 remoting.ClientSession.Mode.ME2ME, onClientStateChange_); |
507 remoting.clientSession.createPluginAndConnect( | 511 remoting.clientSession.createPluginAndConnect( |
508 document.getElementById('session-mode'), | 512 document.getElementById('session-mode'), |
509 token); | 513 token); |
510 remoting.setScaleToFit(remoting.clientSession.getScaleToFit()); | 514 remoting.setScaleToFit(remoting.clientSession.getScaleToFit()); |
511 } else { | 515 } else { |
512 showConnectError_(remoting.Error.AUTHENTICATION_FAILED); | 516 showConnectError_(remoting.Error.AUTHENTICATION_FAILED); |
513 } | 517 } |
514 } | 518 } |
OLD | NEW |