OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 user-facing aspects of the client session. | 7 * Class handling user-facing aspects of the client session. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // and the Ctrl-Alt-Del button only in Me2Me mode. | 142 // and the Ctrl-Alt-Del button only in Me2Me mode. |
143 if (!this.plugin_.hasFeature( | 143 if (!this.plugin_.hasFeature( |
144 remoting.ClientPlugin.Feature.INJECT_KEY_EVENT)) { | 144 remoting.ClientPlugin.Feature.INJECT_KEY_EVENT)) { |
145 var sendKeysElement = document.getElementById('send-keys-menu'); | 145 var sendKeysElement = document.getElementById('send-keys-menu'); |
146 sendKeysElement.hidden = true; | 146 sendKeysElement.hidden = true; |
147 } else if (this.mode_ != remoting.DesktopConnectedView.Mode.ME2ME && | 147 } else if (this.mode_ != remoting.DesktopConnectedView.Mode.ME2ME && |
148 this.mode_ != remoting.DesktopConnectedView.Mode.APP_REMOTING) { | 148 this.mode_ != remoting.DesktopConnectedView.Mode.APP_REMOTING) { |
149 var sendCadElement = document.getElementById('send-ctrl-alt-del'); | 149 var sendCadElement = document.getElementById('send-ctrl-alt-del'); |
150 sendCadElement.hidden = true; | 150 sendCadElement.hidden = true; |
151 } | 151 } |
152 | |
153 if (this.session_.hasCapability( | |
154 remoting.ClientSession.Capability.VIDEO_RECORDER)) { | |
155 this.videoFrameRecorder_ = new remoting.VideoFrameRecorder(this.plugin_); | |
156 } | |
157 }; | 152 }; |
158 | 153 |
159 /** | 154 /** |
160 * This is a callback that gets called when the window is resized. | 155 * This is a callback that gets called when the window is resized. |
161 * | 156 * |
162 * @return {void} Nothing. | 157 * @return {void} Nothing. |
163 * @private. | 158 * @private. |
164 */ | 159 */ |
165 remoting.DesktopConnectedView.prototype.onResize_ = function() { | 160 remoting.DesktopConnectedView.prototype.onResize_ = function() { |
166 if (this.viewport_) { | 161 if (this.viewport_) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 /** | 250 /** |
256 * Sends a Print Screen keypress to the remoting client. | 251 * Sends a Print Screen keypress to the remoting client. |
257 * | 252 * |
258 * @return {void} Nothing. | 253 * @return {void} Nothing. |
259 */ | 254 */ |
260 remoting.DesktopConnectedView.prototype.sendPrintScreen = function() { | 255 remoting.DesktopConnectedView.prototype.sendPrintScreen = function() { |
261 console.log('Sending Print Screen.'); | 256 console.log('Sending Print Screen.'); |
262 this.plugin_.injectKeyCombination([0x070046]); | 257 this.plugin_.injectKeyCombination([0x070046]); |
263 }; | 258 }; |
264 | 259 |
| 260 /** @param {remoting.VideoFrameRecorder} recorder */ |
| 261 remoting.DesktopConnectedView.prototype.setVideoFrameRecorder = |
| 262 function(recorder) { |
| 263 this.videoFrameRecorder_ = recorder; |
| 264 }; |
| 265 |
265 /** | 266 /** |
266 * Returns true if the ClientSession can record video frames to a file. | 267 * Returns true if the ClientSession can record video frames to a file. |
267 * @return {boolean} | 268 * @return {boolean} |
268 */ | 269 */ |
269 remoting.DesktopConnectedView.prototype.canRecordVideo = function() { | 270 remoting.DesktopConnectedView.prototype.canRecordVideo = function() { |
270 return !!this.videoFrameRecorder_; | 271 return !!this.videoFrameRecorder_; |
271 }; | 272 }; |
272 | 273 |
273 /** | 274 /** |
274 * Returns true if the ClientSession is currently recording video frames. | 275 * Returns true if the ClientSession is currently recording video frames. |
275 * @return {boolean} | 276 * @return {boolean} |
276 */ | 277 */ |
277 remoting.DesktopConnectedView.prototype.isRecordingVideo = function() { | 278 remoting.DesktopConnectedView.prototype.isRecordingVideo = function() { |
278 if (!this.videoFrameRecorder_) { | 279 if (!this.videoFrameRecorder_) { |
279 return false; | 280 return false; |
280 } | 281 } |
281 return this.videoFrameRecorder_.isRecording(); | 282 return this.videoFrameRecorder_.isRecording(); |
282 }; | 283 }; |
283 | 284 |
284 /** | 285 /** |
285 * Starts or stops recording of video frames. | 286 * Starts or stops recording of video frames. |
286 */ | 287 */ |
287 remoting.DesktopConnectedView.prototype.startStopRecording = function() { | 288 remoting.DesktopConnectedView.prototype.startStopRecording = function() { |
288 if (this.videoFrameRecorder_) { | 289 if (this.videoFrameRecorder_) { |
289 this.videoFrameRecorder_.startStopRecording(); | 290 this.videoFrameRecorder_.startStopRecording(); |
290 } | 291 } |
291 }; | 292 }; |
292 | |
293 /** | |
294 * Handles protocol extension messages. | |
295 * @param {string} type Type of extension message. | |
296 * @param {Object} message The parsed extension message data. | |
297 * @return {boolean} True if the message was recognized, false otherwise. | |
298 */ | |
299 remoting.DesktopConnectedView.prototype.handleExtensionMessage = | |
300 function(type, message) { | |
301 if (this.videoFrameRecorder_) { | |
302 return this.videoFrameRecorder_.handleMessage(type, message); | |
303 } | |
304 return false; | |
305 }; | |
OLD | NEW |