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

Unified Diff: remoting/webapp/toolbar.js

Issue 336293003: Refactor tool-bar event handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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/session_connector.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/toolbar.js
diff --git a/remoting/webapp/toolbar.js b/remoting/webapp/toolbar.js
index f71bc3d011a363070f60e30ef87c8951108cbb35..56c28a469c5032b95cac3c16bb7030d1e777819e 100644
--- a/remoting/webapp/toolbar.js
+++ b/remoting/webapp/toolbar.js
@@ -42,6 +42,16 @@ remoting.Toolbar = function(toolbar) {
* @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('toggle-full-screen'));
window.addEventListener('mousemove', remoting.Toolbar.onMouseMove, false);
window.addEventListener('resize', this.center.bind(this), false);
@@ -50,9 +60,6 @@ remoting.Toolbar = function(toolbar) {
function() {
chrome.app.window.create('main.html', { 'width': 800, 'height': 600 });
});
- 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(); });
@@ -104,6 +111,16 @@ remoting.Toolbar.prototype.toggle = function() {
};
/**
+ * @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.getHostDisplayName();
+};
+
+/**
* Test the specified co-ordinate to see if it is close enough to the stub
* to activate it.
*
« no previous file with comments | « remoting/webapp/session_connector.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698