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

Unified Diff: remoting/webapp/crd/js/options_menu.js

Issue 1089493002: [Webapp Refactor] Re-add remoting.ConnectionStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's feedback Created 5 years, 8 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/crd/js/desktop_connected_view.js ('k') | remoting/webapp/crd/js/remoting.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/options_menu.js
diff --git a/remoting/webapp/crd/js/options_menu.js b/remoting/webapp/crd/js/options_menu.js
index 0d1a10e8e10c300da2ddec435ab397ab2e667623..4f2cb1c18a3b989fd300562e3fba8fcdd7afc9fa 100644
--- a/remoting/webapp/crd/js/options_menu.js
+++ b/remoting/webapp/crd/js/options_menu.js
@@ -19,12 +19,13 @@ var remoting = remoting || {};
* @param {Element} shrinkToFit
* @param {Element} newConnection
* @param {Element?} fullscreen
+ * @param {Element?} toggleStats
* @param {Element?} startStopRecording
* @constructor
*/
remoting.OptionsMenu = function(sendCtrlAltDel, sendPrtScrn,
resizeToClient, shrinkToFit,
- newConnection, fullscreen,
+ newConnection, fullscreen, toggleStats,
startStopRecording) {
this.sendCtrlAltDel_ = sendCtrlAltDel;
this.sendPrtScrn_ = sendPrtScrn;
@@ -32,6 +33,7 @@ remoting.OptionsMenu = function(sendCtrlAltDel, sendPrtScrn,
this.shrinkToFit_ = shrinkToFit;
this.newConnection_ = newConnection;
this.fullscreen_ = fullscreen;
+ this.toggleStats_ = toggleStats;
this.startStopRecording_ = startStopRecording;
/** @private {remoting.DesktopConnectedView} */
@@ -47,9 +49,13 @@ remoting.OptionsMenu = function(sendCtrlAltDel, sendPrtScrn,
'click', this.onShrinkToFit_.bind(this), false);
this.newConnection_.addEventListener(
'click', this.onNewConnection_.bind(this), false);
+
if (this.fullscreen_) {
- this.fullscreen_.addEventListener(
- 'click', this.onFullscreen_.bind(this), false);
+ fullscreen.addEventListener('click', this.onFullscreen_.bind(this), false);
+ }
+ if (this.toggleStats_) {
+ toggleStats.addEventListener(
+ 'click', this.onToggleStats_.bind(this), false);
}
if (this.startStopRecording_) {
this.startStopRecording_.addEventListener(
@@ -74,10 +80,15 @@ remoting.OptionsMenu.prototype.onShow = function() {
this.resizeToClient_, this.desktopConnectedView_.getResizeToClient());
remoting.MenuButton.select(
this.shrinkToFit_, this.desktopConnectedView_.getShrinkToFit());
+
if (this.fullscreen_) {
remoting.MenuButton.select(
this.fullscreen_, remoting.fullscreen.isActive());
}
+ if (this.toggleStats_) {
+ remoting.MenuButton.select(
+ this.toggleStats_, this.desktopConnectedView_.isStatsVisible());
+ }
if (this.startStopRecording_) {
this.startStopRecording_.hidden =
!this.desktopConnectedView_.canRecordVideo();
@@ -132,11 +143,17 @@ remoting.OptionsMenu.prototype.onFullscreen_ = function() {
remoting.fullscreen.toggle();
};
+remoting.OptionsMenu.prototype.onToggleStats_ = function() {
+ if (this.desktopConnectedView_) {
+ this.desktopConnectedView_.toggleStats();
+ }
+};
+
remoting.OptionsMenu.prototype.onStartStopRecording_ = function() {
if (this.desktopConnectedView_) {
this.desktopConnectedView_.startStopRecording();
}
-}
+};
/**
* @type {remoting.OptionsMenu}
« no previous file with comments | « remoting/webapp/crd/js/desktop_connected_view.js ('k') | remoting/webapp/crd/js/remoting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698