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

Unified Diff: extensions/renderer/resources/guest_view/web_view/web_view_events.js

Issue 2942023003: [Extensions Bindings] Correctly create the sendMessage webview event (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/guest_view/web_view/web_view_events.js
diff --git a/extensions/renderer/resources/guest_view/web_view/web_view_events.js b/extensions/renderer/resources/guest_view/web_view/web_view_events.js
index b413af3f72cdbea9617958d51ff6fb9f836847c7..c52684d7a444f87278f17b2af797595c9f96c7a1 100644
--- a/extensions/renderer/resources/guest_view/web_view/web_view_events.js
+++ b/extensions/renderer/resources/guest_view/web_view/web_view_events.js
@@ -36,12 +36,17 @@ function createCustomDeclarativeEvent(name, schema, options, webviewId) {
return new jsEvent(name, schema, options, webviewId);
}
+function createCustomEvent(name, schema, options) {
+ if (bindingUtil)
+ return bindingUtil.createCustomEvent(name, undefined, false);
+ if (!jsEvent)
+ jsEvent = require('event_bindings').Event;
+ return new jsEvent(name, schema, options);
+}
+
function createOnMessageEvent(name, schema, options, webviewId) {
var subEventName = name + '/' + IdGenerator.GetNextId();
- var newEvent = createCustomDeclarativeEvent(subEventName,
- schema,
- options,
- webviewId);
+ var newEvent = createCustomEvent(subEventName, schema, options);
var view = GuestViewInternalNatives.GetViewFromID(webviewId || 0);
if (view) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698