summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 16:17:29 +0000
committersimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 16:17:29 +0000
commit89a673edebf3f9b97793eb708906f91eb9cac1c5 (patch)
treef9d9fa70c290dbf21316d8fb93f62c0c37a069cc
parent66f143a54118da58a159f16647963560beeea0cf (diff)
downloadchromium_src-89a673edebf3f9b97793eb708906f91eb9cac1c5.zip
chromium_src-89a673edebf3f9b97793eb708906f91eb9cac1c5.tar.gz
chromium_src-89a673edebf3f9b97793eb708906f91eb9cac1c5.tar.bz2
[Chromoting] Stop the user typing non-digits when setting the daemon PIN.
BUG=121516 Review URL: https://chromiumcodereview.appspot.com/9939016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130935 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/webapp/host_setup_dialog.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/remoting/webapp/host_setup_dialog.js b/remoting/webapp/host_setup_dialog.js
index e4e222b..ad77b73 100644
--- a/remoting/webapp/host_setup_dialog.js
+++ b/remoting/webapp/host_setup_dialog.js
@@ -123,7 +123,15 @@ remoting.HostSetupDialog = function(daemon) {
event.preventDefault();
}
};
+ /** @param {Event} event A keypress event. */
+ var noDigitsInPin = function(event) {
+ if ((event.which < 48) || (event.which > 57)) {
+ event.preventDefault();
+ }
+ };
this.pinEntry_.addEventListener('keypress', onDaemonPinEntryKeyPress, false);
+ this.pinEntry_.addEventListener('keypress', noDigitsInPin, false);
+ this.pinConfirm_.addEventListener('keypress', noDigitsInPin, false);
};
/**