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

Unified Diff: remoting/webapp/options_menu.js

Issue 386853002: Add a Record button to the web-app if the host supports video recording. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: function -> var Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/manifest.json.jinja2 ('k') | remoting/webapp/toolbar.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/options_menu.js
diff --git a/remoting/webapp/options_menu.js b/remoting/webapp/options_menu.js
index ca6d6156bc5f43436c5e95bb05151bacd2a3c50a..fce3bc9e9611d835b48afc14bd493b2acdbc1c4a 100644
--- a/remoting/webapp/options_menu.js
+++ b/remoting/webapp/options_menu.js
@@ -19,17 +19,20 @@ var remoting = remoting || {};
* @param {Element} shrinkToFit
* @param {Element} newConnection
* @param {Element?} fullscreen
+ * @param {Element?} startStopRecording
* @constructor
*/
remoting.OptionsMenu = function(sendCtrlAltDel, sendPrtScrn,
resizeToClient, shrinkToFit,
- newConnection, fullscreen) {
+ newConnection, fullscreen,
+ startStopRecording) {
this.sendCtrlAltDel_ = sendCtrlAltDel;
this.sendPrtScrn_ = sendPrtScrn;
this.resizeToClient_ = resizeToClient;
this.shrinkToFit_ = shrinkToFit;
this.newConnection_ = newConnection;
this.fullscreen_ = fullscreen;
+ this.startStopRecording_ = startStopRecording;
/**
* @type {remoting.ClientSession}
* @private
@@ -50,6 +53,10 @@ remoting.OptionsMenu = function(sendCtrlAltDel, sendPrtScrn,
this.fullscreen_.addEventListener(
'click', this.onFullscreen_.bind(this), false);
}
+ if (this.startStopRecording_) {
+ this.startStopRecording_.addEventListener(
+ 'click', this.onStartStopRecording_.bind(this), false);
+ }
};
/**
@@ -70,6 +77,16 @@ remoting.OptionsMenu.prototype.onShow = function() {
remoting.MenuButton.select(
this.fullscreen_, remoting.fullscreen.isActive());
}
+ if (this.startStopRecording_) {
+ this.startStopRecording_.hidden = !this.clientSession_.canRecordVideo();
+ if (this.clientSession_.isRecordingVideo()) {
+ l10n.localizeElementFromTag(this.startStopRecording_,
+ /*i18n-content*/'STOP_RECORDING');
+ } else {
+ l10n.localizeElementFromTag(this.startStopRecording_,
+ /*i18n-content*/'START_RECORDING');
+ }
+ }
}
};
@@ -110,3 +127,9 @@ remoting.OptionsMenu.prototype.onNewConnection_ = function() {
remoting.OptionsMenu.prototype.onFullscreen_ = function() {
remoting.fullscreen.toggle();
};
+
+remoting.OptionsMenu.prototype.onStartStopRecording_ = function() {
+ if (this.clientSession_) {
+ this.clientSession_.startStopRecording();
+ }
+}
« no previous file with comments | « remoting/webapp/manifest.json.jinja2 ('k') | remoting/webapp/toolbar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698