Index: remoting/webapp/toolbar.js |
diff --git a/remoting/webapp/toolbar.js b/remoting/webapp/toolbar.js |
index e75bef165daae68e0dc54b8ab5a7e218d56ec6aa..d6a6942249619aa50bba0ea071642b2492365234 100644 |
--- a/remoting/webapp/toolbar.js |
+++ b/remoting/webapp/toolbar.js |
@@ -42,18 +42,22 @@ remoting.Toolbar = function(toolbar) { |
* @private |
*/ |
this.stubRight_ = 0; |
+ |
/** |
- * @type {remoting.OptionsMenu} |
+ * @type {remoting.MenuButton} |
* @private |
*/ |
- this.optionsMenu_ = new remoting.OptionsMenu( |
- document.getElementById('send-ctrl-alt-del'), |
- document.getElementById('send-print-screen'), |
- document.getElementById('screen-resize-to-client'), |
- document.getElementById('screen-shrink-to-fit'), |
- document.getElementById('new-connection'), |
- document.getElementById('toggle-full-screen'), |
- null); |
+ this.screenOptionsMenu_ = new remoting.MenuButton( |
+ document.getElementById('screen-options-menu'), |
+ this.onShowOptionsMenu_.bind(this)); |
+ /** |
+ * @type {remoting.MenuButton} |
+ * @private |
+ */ |
+ this.sendKeysMenu_ = new remoting.MenuButton( |
+ document.getElementById('send-keys-menu') |
+ ); |
+ |
window.addEventListener('mousemove', remoting.Toolbar.onMouseMove, false); |
window.addEventListener('resize', this.center.bind(this), false); |
@@ -74,6 +78,21 @@ remoting.Toolbar = function(toolbar) { |
this.toolbar_.addEventListener('mousemove', stopTimer, false); |
}; |
+ |
+/** |
+ * @return {remoting.OptionsMenu} |
+ */ |
+remoting.Toolbar.prototype.createOptionsMenu = function() { |
+ return new remoting.OptionsMenu( |
+ document.getElementById('send-ctrl-alt-del'), |
+ document.getElementById('send-print-screen'), |
+ document.getElementById('screen-resize-to-client'), |
+ document.getElementById('screen-shrink-to-fit'), |
+ document.getElementById('new-connection'), |
+ document.getElementById('toggle-full-screen'), |
+ null); |
+}; |
+ |
/** |
* Preview the tool-bar functionality by showing it for 3s. |
* @return {void} Nothing. |
@@ -113,7 +132,6 @@ remoting.Toolbar.prototype.toggle = function() { |
* there is no connection. |
*/ |
remoting.Toolbar.prototype.setClientSession = function(clientSession) { |
- this.optionsMenu_.setClientSession(clientSession); |
var connectedTo = document.getElementById('connected-to'); |
connectedTo.innerText = |
clientSession ? clientSession.getHostDisplayName() : ""; |
@@ -158,6 +176,16 @@ remoting.Toolbar.onMouseMove = function(event) { |
} |
}; |
+/** |
+ * Updates the options menu to reflect the current scale-to-fit and full-screen |
+ * settings. |
+ * @return {void} Nothing. |
+ * @private |
+ */ |
+remoting.Toolbar.prototype.onShowOptionsMenu_ = function() { |
+ remoting.optionsMenu.onShow(); |
+}; |
+ |
/** @type {remoting.Toolbar} */ |
remoting.toolbar = null; |