Chromium Code Reviews| Index: chrome/renderer/resources/extensions/web_view/chrome_web_view.js |
| diff --git a/chrome/renderer/resources/extensions/web_view/chrome_web_view.js b/chrome/renderer/resources/extensions/web_view/chrome_web_view.js |
| index abad16253e0727be18eaf94dec8c794c4558cdd2..a478699384d22f2391446c9ec2b0da5f1196da39 100644 |
| --- a/chrome/renderer/resources/extensions/web_view/chrome_web_view.js |
| +++ b/chrome/renderer/resources/extensions/web_view/chrome_web_view.js |
| @@ -37,11 +37,8 @@ function ContextMenusOnClickedEvent(webViewInstanceId, |
| opt_argSchemas, |
| opt_eventOptions) { |
| var subEventName = GetUniqueSubEventName(opt_eventName); |
| - EventBindings.Event.call(this, |
| - subEventName, |
| - opt_argSchemas, |
| - opt_eventOptions, |
| - webViewInstanceId); |
| + $Function.call(EventBindings.Event, this, |
| + subEventName, opt_argSchemas, opt_eventOptions, webViewInstanceId); |
|
Devlin
2016/04/26 22:41:25
nit: prefer to line these params up (multiple line
robwu
2016/04/26 23:14:33
Done.
|
| var view = GuestViewInternalNatives.GetViewFromID(webViewInstanceId); |
| if (!view) { |
| @@ -52,19 +49,17 @@ function ContextMenusOnClickedEvent(webViewInstanceId, |
| $Function.apply(this.dispatch, this, $Array.slice(arguments)); |
| }.bind(this), {instanceId: webViewInstanceId}); |
| } |
| +$Object.setPrototypeOf( |
| + ContextMenusOnClickedEvent.prototype, EventBindings.Event.prototype); |
| -ContextMenusOnClickedEvent.prototype.__proto__ = EventBindings.Event.prototype; |
| - |
| +// This event is exposed as <webview>.contextMenus.onShow. |
| function ContextMenusOnContextMenuEvent(webViewInstanceId, |
| opt_eventName, |
| opt_argSchemas, |
| opt_eventOptions) { |
| var subEventName = GetUniqueSubEventName(opt_eventName); |
| - EventBindings.Event.call(this, |
| - subEventName, |
| - opt_argSchemas, |
| - opt_eventOptions, |
| - webViewInstanceId); |
| + $Function.call(EventBindings.Event, this, |
| + subEventName, opt_argSchemas, opt_eventOptions, webViewInstanceId); |
| var view = GuestViewInternalNatives.GetViewFromID(webViewInstanceId); |
| if (!view) { |
| @@ -91,8 +86,8 @@ function ContextMenusOnContextMenuEvent(webViewInstanceId, |
| }.bind(this), {instanceId: webViewInstanceId}); |
| } |
| -ContextMenusOnContextMenuEvent.prototype.__proto__ = |
| - EventBindings.Event.prototype; |
| +$Object.setPrototypeOf( |
| + ContextMenusOnContextMenuEvent.prototype, EventBindings.Event.prototype); |
| // ----------------------------------------------------------------------------- |
| // WebViewContextMenusImpl object. |
| @@ -101,6 +96,8 @@ ContextMenusOnContextMenuEvent.prototype.__proto__ = |
| function WebViewContextMenusImpl(viewInstanceId) { |
| this.viewInstanceId_ = viewInstanceId; |
| } |
| +$Object.setPrototypeOf(WebViewContextMenusImpl, null); |
| +$Object.setPrototypeOf(WebViewContextMenusImpl.prototype, null); |
| WebViewContextMenusImpl.prototype.create = function() { |
| var args = $Array.concat([this.viewInstanceId_], $Array.slice(arguments)); |
| @@ -188,8 +185,6 @@ WebViewImpl.prototype.maybeSetupContextMenus = function() { |
| }.bind(this); |
| // Expose <webview>.contextMenus object. |
| - // TODO(lazyboy): Add documentation for contextMenus: |
| - // http://crbug.com/470979. |
| $Object.defineProperty( |
| this.element, |
| 'contextMenus', |