Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 * This class implements the functionality that is specific to desktop | 7 * This class implements the functionality that is specific to desktop |
| 8 * remoting ("Chromoting" or CRD). | 8 * remoting ("Chromoting" or CRD). |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 } | 90 } |
| 91 ); | 91 ); |
| 92 | 92 |
| 93 } else { | 93 } else { |
| 94 remoting.fullscreen = new remoting.FullscreenAppsV1(); | 94 remoting.fullscreen = new remoting.FullscreenAppsV1(); |
| 95 remoting.toolbar = new remoting.Toolbar( | 95 remoting.toolbar = new remoting.Toolbar( |
| 96 document.getElementById('session-toolbar')); | 96 document.getElementById('session-toolbar')); |
| 97 remoting.optionsMenu = remoting.toolbar.createOptionsMenu(); | 97 remoting.optionsMenu = remoting.toolbar.createOptionsMenu(); |
| 98 | 98 |
| 99 window.addEventListener('beforeunload', remoting.promptClose, false); | 99 window.addEventListener('beforeunload', remoting.promptClose, false); |
| 100 window.addEventListener('unload', remoting.disconnect, false); | 100 window.addEventListener('unload', remoting.app.disconnect, false); |
|
Jamie
2015/03/04 01:06:54
bind?
kelvinp
2015/03/04 21:02:21
Done.
| |
| 101 } | 101 } |
| 102 | 102 |
| 103 // When a window goes full-screen, a resize event is triggered, but the | |
| 104 // Fullscreen.isActive call is not guaranteed to return true until the | |
| 105 // full-screen event is triggered. In apps v2, the size of the window's | |
| 106 // client area is calculated differently in full-screen mode, so register | |
| 107 // for both events. | |
| 108 window.addEventListener('resize', remoting.onResize, false); | |
| 109 remoting.fullscreen.addListener(remoting.onResize); | |
|
Jamie
2015/03/04 01:06:54
This was previously specific to CRD. If there are
kelvinp
2015/03/04 21:02:21
This is a good point. Looking glass should be fin
| |
| 110 | |
| 111 remoting.initHostlist_(); | 103 remoting.initHostlist_(); |
| 112 | 104 |
| 113 var homeFeedback = new remoting.MenuButton( | 105 var homeFeedback = new remoting.MenuButton( |
| 114 document.getElementById('help-feedback-main')); | 106 document.getElementById('help-feedback-main')); |
| 115 var toolbarFeedback = new remoting.MenuButton( | 107 var toolbarFeedback = new remoting.MenuButton( |
| 116 document.getElementById('help-feedback-toolbar')); | 108 document.getElementById('help-feedback-toolbar')); |
| 117 remoting.manageHelpAndFeedback( | 109 remoting.manageHelpAndFeedback( |
| 118 document.getElementById('title-bar')); | 110 document.getElementById('title-bar')); |
| 119 remoting.manageHelpAndFeedback( | 111 remoting.manageHelpAndFeedback( |
| 120 document.getElementById('help-feedback-toolbar')); | 112 document.getElementById('help-feedback-toolbar')); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 226 clientSession.requestPairing(clientName, onPairingComplete); | 218 clientSession.requestPairing(clientName, onPairingComplete); |
| 227 } | 219 } |
| 228 }; | 220 }; |
| 229 | 221 |
| 230 /** | 222 /** |
| 231 * Called when the current session has been disconnected. | 223 * Called when the current session has been disconnected. |
| 232 * | 224 * |
| 233 * @return {void} Nothing. | 225 * @return {void} Nothing. |
| 234 */ | 226 */ |
| 235 remoting.DesktopRemoting.prototype.handleDisconnected = function() { | 227 remoting.DesktopRemoting.prototype.handleDisconnected = function() { |
| 228 if (remoting.desktopConnectedView.getMode() == | |
| 229 remoting.DesktopConnectedView.Mode.IT2ME) { | |
| 230 remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED_IT2ME); | |
| 231 remoting.hangoutSessionEvents.raiseEvent( | |
|
Jamie
2015/03/04 01:06:54
Can we get rid of this now?
kelvinp
2015/03/04 21:02:21
This will be gone after a rebase as it is already
| |
| 232 remoting.hangoutSessionEvents.sessionStateChanged, | |
| 233 remoting.ClientSession.State.CLOSED); | |
| 234 } else { | |
| 235 remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED_ME2ME); | |
| 236 } | |
| 236 }; | 237 }; |
| 237 | 238 |
| 238 /** | 239 /** |
| 239 * Called when the current session's connection has failed. | 240 * Called when the current session's connection has failed. |
| 240 * | 241 * |
| 241 * @param {remoting.SessionConnector} connector | 242 * @param {remoting.SessionConnector} connector |
| 242 * @param {remoting.Error} error | 243 * @param {remoting.Error} error |
| 243 * @return {void} Nothing. | 244 * @return {void} Nothing. |
| 244 */ | 245 */ |
| 245 remoting.DesktopRemoting.prototype.handleConnectionFailed = function( | 246 remoting.DesktopRemoting.prototype.handleConnectionFailed = function( |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 if (mode == remoting.DesktopConnectedView.Mode.IT2ME) { | 316 if (mode == remoting.DesktopConnectedView.Mode.IT2ME) { |
| 316 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME); | 317 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME); |
| 317 remoting.hangoutSessionEvents.raiseEvent( | 318 remoting.hangoutSessionEvents.raiseEvent( |
| 318 remoting.hangoutSessionEvents.sessionStateChanged, | 319 remoting.hangoutSessionEvents.sessionStateChanged, |
| 319 remoting.ClientSession.State.FAILED | 320 remoting.ClientSession.State.FAILED |
| 320 ); | 321 ); |
| 321 } else { | 322 } else { |
| 322 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); | 323 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); |
| 323 } | 324 } |
| 324 }; | 325 }; |
| OLD | NEW |