summaryrefslogtreecommitdiffstats
path: root/remoting/tools
diff options
context:
space:
mode:
authorjamiewalch <jamiewalch@chromium.org>2015-02-05 19:40:39 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-06 03:42:41 +0000
commit16accd4cbfbf5ebd9adafc67164d359ab6f54e43 (patch)
treecff91868bc267c3adda075f37a9ffe4e4a0284fa /remoting/tools
parent33e0ed259a19bc6c918fa11fcacffdf709440447 (diff)
downloadchromium_src-16accd4cbfbf5ebd9adafc67164d359ab6f54e43.zip
chromium_src-16accd4cbfbf5ebd9adafc67164d359ab6f54e43.tar.gz
chromium_src-16accd4cbfbf5ebd9adafc67164d359ab6f54e43.tar.bz2
Reinstated onBlur handler and added images for CWS.
The onBlur handler was accidentally removed by my recent refactoring. The images are required for submissions to CWS; only the icon needs to included in the crx, however. Review URL: https://codereview.chromium.org/868663007 Cr-Commit-Position: refs/heads/master@{#314961}
Diffstat (limited to 'remoting/tools')
-rw-r--r--remoting/tools/javascript_key_tester/event_listeners.js22
-rw-r--r--remoting/tools/javascript_key_tester/icon_128.pngbin0 -> 789 bytes
-rw-r--r--remoting/tools/javascript_key_tester/manifest.json3
-rw-r--r--remoting/tools/javascript_key_tester/promo_440x280.pngbin0 -> 2180 bytes
-rw-r--r--remoting/tools/javascript_key_tester/screenshot_640x400.pngbin0 -> 43113 bytes
5 files changed, 20 insertions, 5 deletions
diff --git a/remoting/tools/javascript_key_tester/event_listeners.js b/remoting/tools/javascript_key_tester/event_listeners.js
index 529a08d..a70d40c 100644
--- a/remoting/tools/javascript_key_tester/event_listeners.js
+++ b/remoting/tools/javascript_key_tester/event_listeners.js
@@ -36,7 +36,8 @@ var EventListeners = function(jsLog, pnaclLog, textLog,
this.onKeyUpHandler_ = this.onKeyUp_.bind(this);
this.onKeyPressHandler_ = this.onKeyPress_.bind(this);
this.onMessageHandler_ = this.onMessage_.bind(this);
- this.onBlurHandler_ = this.onBlur_.bind(this);
+ this.onPluginBlurHandler_ = this.onPluginBlur_.bind(this);
+ this.onWindowBlurHandler_ = this.onWindowBlur_.bind(this);
this.jsChordTracker_ = new ChordTracker(jsLog);
this.pnaclChordTracker_ = new ChordTracker(pnaclLog);
@@ -48,24 +49,27 @@ var EventListeners = function(jsLog, pnaclLog, textLog,
* Start listening for keyboard events.
*/
EventListeners.prototype.activate = function() {
+ window.addEventListener('blur', this.onWindowBlurHandler_, false);
document.body.addEventListener('keydown', this.onKeyDownHandler_, false);
document.body.addEventListener('keyup', this.onKeyUpHandler_, false);
document.body.addEventListener('keypress', this.onKeyPressHandler_, false);
this.pnaclListener_.addEventListener('message', this.onMessageHandler_, true);
- this.pnaclPlugin_.addEventListener('blur', this.onBlurHandler_, false);
- this.onBlur_();
+ this.pnaclPlugin_.addEventListener('blur', this.onPluginBlurHandler_, false);
+ this.onPluginBlur_();
};
/**
* Stop listening for keyboard events.
*/
EventListeners.prototype.deactivate = function() {
+ window.removeEventListener('blur', this.onWindowBlurHandler_, false);
document.body.removeEventListener('keydown', this.onKeyDownHandler_, false);
document.body.removeEventListener('keyup', this.onKeyUpHandler_, false);
document.body.removeEventListener('keypress', this.onKeyPressHandler_, false);
this.pnaclListener_.removeEventListener(
'message', this.onMessageHandler_, true);
- this.pnaclPlugin_.removeEventListener('blur', this.onBlurHandler_, false);
+ this.pnaclPlugin_.removeEventListener(
+ 'blur', this.onPluginBlurHandler_, false);
};
/**
@@ -122,11 +126,19 @@ EventListeners.prototype.onMessage_ = function (event) {
/**
* @return {void}
*/
-EventListeners.prototype.onBlur_ = function() {
+EventListeners.prototype.onPluginBlur_ = function() {
this.pnaclPlugin_.focus();
};
/**
+ * @return {void}
+ */
+EventListeners.prototype.onWindowBlur_ = function() {
+ this.jsChordTracker_.releaseAllKeys();
+ this.pnaclChordTracker_.releaseAllKeys();
+};
+
+/**
* @param {string} str
* @private
*/
diff --git a/remoting/tools/javascript_key_tester/icon_128.png b/remoting/tools/javascript_key_tester/icon_128.png
new file mode 100644
index 0000000..77503b8
--- /dev/null
+++ b/remoting/tools/javascript_key_tester/icon_128.png
Binary files differ
diff --git a/remoting/tools/javascript_key_tester/manifest.json b/remoting/tools/javascript_key_tester/manifest.json
index 29e6693..625a472 100644
--- a/remoting/tools/javascript_key_tester/manifest.json
+++ b/remoting/tools/javascript_key_tester/manifest.json
@@ -2,6 +2,9 @@
"name": "Javascript key event tester",
"version": "1.1",
"manifest_version": 2,
+ "icons": {
+ "128": "icon_128.png"
+ },
"app": {
"background": {
"scripts": ["background.js"]
diff --git a/remoting/tools/javascript_key_tester/promo_440x280.png b/remoting/tools/javascript_key_tester/promo_440x280.png
new file mode 100644
index 0000000..f8cb5ce
--- /dev/null
+++ b/remoting/tools/javascript_key_tester/promo_440x280.png
Binary files differ
diff --git a/remoting/tools/javascript_key_tester/screenshot_640x400.png b/remoting/tools/javascript_key_tester/screenshot_640x400.png
new file mode 100644
index 0000000..18e9aa7
--- /dev/null
+++ b/remoting/tools/javascript_key_tester/screenshot_640x400.png
Binary files differ