diff options
author | jamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-22 02:27:49 +0000 |
---|---|---|
committer | jamiewalch@google.com <jamiewalch@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-22 02:27:49 +0000 |
commit | 753d75920cee11092f825e02af4c8e93a4d8acea (patch) | |
tree | efc983cd9ac0b7951d7b9033b6acb3dbb97accae /remoting | |
parent | 00bbe166d7ec00625a5279016da55896196fd6c9 (diff) | |
download | chromium_src-753d75920cee11092f825e02af4c8e93a4d8acea.zip chromium_src-753d75920cee11092f825e02af4c8e93a4d8acea.tar.gz chromium_src-753d75920cee11092f825e02af4c8e93a4d8acea.tar.bz2 |
Restore plugin focus on blur.
BUG=Internal
TEST=Manual
Review URL: http://codereview.chromium.org/9017040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/webapp/me2mom/client_session.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/remoting/webapp/me2mom/client_session.js b/remoting/webapp/me2mom/client_session.js index 71adfda..a63f9fe 100644 --- a/remoting/webapp/me2mom/client_session.js +++ b/remoting/webapp/me2mom/client_session.js @@ -37,9 +37,14 @@ remoting.ClientSession = function(hostJid, hostPublicKey, accessCode, email, this.email = email; this.clientJid = ''; this.sessionId = ''; - /** @type {remoting.ViewerPlugin} */ this.plugin = null; + /** @type {remoting.ViewerPlugin} */ + this.plugin = null; this.logToServer = new remoting.LogToServer(); this.onStateChange = onStateChange; + /** @type {remoting.ClientSession} */ + var that = this; + /** @type {function():void} @private */ + this.refocusPlugin_ = function() { that.plugin.focus(); }; }; // Note that the positive values in both of these enums are copied directly @@ -152,8 +157,12 @@ remoting.ClientSession.prototype.createPluginAndConnect = this.plugin.type = 'pepper-application/x-chromoting'; this.plugin.width = 0; this.plugin.height = 0; + this.plugin.tabIndex = 0; // Required, otherwise focus() doesn't work. container.appendChild(this.plugin); + this.plugin.focus(); + this.plugin.addEventListener('blur', this.refocusPlugin_, false); + if (!this.isPluginVersionSupported_(this.plugin)) { // TODO(ajwong): Remove from parent. delete this.plugin; @@ -199,6 +208,7 @@ remoting.ClientSession.prototype.createPluginAndConnect = */ remoting.ClientSession.prototype.removePlugin = function() { if (this.plugin) { + this.plugin.removeEventListener('blur', this.refocusPlugin_, false); var parentNode = this.plugin.parentNode; parentNode.removeChild(this.plugin); this.plugin = null; |