* @private
*/
this.stubRight_ = 0;
+ /**
+ * @type {remoting.OptionsMenu}
+ * @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'));
window.addEventListener('mousemove', remoting.Toolbar.onMouseMove, false);
window.addEventListener('resize', this.center.bind(this), false);
- registerEventListener('new-connection', 'click',
- function() {
- chrome.app.window.create('main.html', {
- 'width': 800,
- 'height': 600,
- 'frame': "none"
- });
- });
- registerEventListener('send-ctrl-alt-del', 'click', remoting.sendCtrlAltDel);
- registerEventListener('send-print-screen', 'click', remoting.sendPrintScreen);
- registerEventListener('sign-out', 'click', remoting.signOut);
registerEventListener('toolbar-disconnect', 'click', remoting.disconnect);
registerEventListener('toolbar-stub', 'click',
function() { remoting.toolbar.toggle(); });
};
/**
+ * @param {remoting.ClientSession} clientSession The active session, or null if
+ * 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() : "";
+};
+
+/**
* Test the specified co-ordinate to see if it is close enough to the stub
* to activate it.
*