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

Unified Diff: remoting/webapp/me2mom/remoting_session.js

Issue 7316011: Release all keys on blur. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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
Index: remoting/webapp/me2mom/remoting_session.js
diff --git a/remoting/webapp/me2mom/remoting_session.js b/remoting/webapp/me2mom/remoting_session.js
index 556d869f358fea3cf92d0bff2adc081d07eba647..cc438089ebcf477ce77f78701e6dc107ab629898 100644
--- a/remoting/webapp/me2mom/remoting_session.js
+++ b/remoting/webapp/me2mom/remoting_session.js
@@ -24,6 +24,7 @@ remoting.httpXmppProxy =
'https://chromoting-httpxmpp-oauth2-dev.corp.google.com';
window.addEventListener("load", init_, false);
+window.addEventListener('blur', pluginLostFocus_, false);
// This executes a poll loop on the server for more Iq packets, and feeds them
// to the plugin.
@@ -115,7 +116,6 @@ function checkVersion(plugin) {
function init_() {
// Kick off the connection.
var plugin = document.getElementById('remoting');
-
remoting.plugin = plugin;
// Only allow https connections to the httpXmppProxy.
@@ -150,6 +150,14 @@ function init_() {
registerConnection();
}
+function pluginLostFocus_() {
+ // If the plug loses input focus, release all keys as a precaution against
+ // leaving them 'stuck down' on the host.
+ if (remoting.plugin) {
+ remoting.plugin.releaseAllKeys();
+ }
+}
+
function toggleScaleToFit() {
remoting.scaleToFit = !remoting.scaleToFit;
document.getElementById('scale-to-fit-toggle').value =

Powered by Google App Engine
This is Rietveld 408576698