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

Unified Diff: chrome/renderer/resources/extensions/tts_engine_custom_bindings.js

Issue 10704073: Plumb listenerIDs correctly for events that clobber chrome.Event.prototype.dispatch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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: chrome/renderer/resources/extensions/tts_engine_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/tts_engine_custom_bindings.js b/chrome/renderer/resources/extensions/tts_engine_custom_bindings.js
index 7c0067b822e9e1dd97c1a1ce87df52bc751afd8d..f16f1438e1a7491a3be40a4b22ac7bd902b77c79 100644
--- a/chrome/renderer/resources/extensions/tts_engine_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/tts_engine_custom_bindings.js
@@ -6,12 +6,13 @@
var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
-chromeHidden.registerCustomHook('ttsEngine', function() {
- chrome.ttsEngine.onSpeak.dispatch = function(text, options, requestId) {
- var sendTtsEvent = function(event) {
- chrome.ttsEngine.sendTtsEvent(requestId, event);
- };
- chrome.Event.prototype.dispatch.apply(
- this, [text, options, sendTtsEvent]);
+chromeHidden.Event.registerArgumentMassager('ttsEngine.onSpeak',
+ function(args, dispatch) {
+ var text = args[0];
+ var options = args[1];
+ var requestId = args[2];
+ var sendTtsEvent = function(event) {
+ chrome.ttsEngine.sendTtsEvent(requestId, event);
};
+ dispatch([text, options, sendTtsEvent]);
});
« no previous file with comments | « chrome/renderer/resources/extensions/omnibox_custom_bindings.js ('k') | chrome/test/base/module_system_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698