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

Unified Diff: chrome/renderer/resources/extensions/input.ime_custom_bindings.js

Issue 11299270: Add a parameter that specifies whether onKeyEvent is asynchronous (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fix Created 8 years 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 | « chrome/common/extensions/api/input_ime.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/input.ime_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/input.ime_custom_bindings.js b/chrome/renderer/resources/extensions/input.ime_custom_bindings.js
index 204a9e0ae81a9c136fe25fc634ac8aabc99f4232..60b01058e44504900cc148b12df894155d0ca722 100644
--- a/chrome/renderer/resources/extensions/input.ime_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/input.ime_custom_bindings.js
@@ -18,6 +18,19 @@ chromeHidden.registerCustomHook('input.ime', function() {
} catch (e) {
console.error('Error in event handler for onKeyEvent: ' + e.stack);
}
- chrome.input.ime.eventHandled(keyData.requestId, result);
+ if (!chrome.input.ime.onKeyEvent.async)
+ chrome.input.ime.keyEventHandled(keyData.requestId, result);
+ };
+
+ chrome.input.ime.onKeyEvent.addListener = function(cb, opt_extraInfo) {
+ chrome.input.ime.onKeyEvent.async = false;
+ if (opt_extraInfo instanceof Array) {
+ for (var i = 0; i < opt_extraInfo.length; ++i) {
+ if (opt_extraInfo[i] == "async") {
+ chrome.input.ime.onKeyEvent.async = true;
+ }
+ }
+ }
+ chrome.Event.prototype.addListener.call(this, cb, null);
};
});
« no previous file with comments | « chrome/common/extensions/api/input_ime.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698