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

Unified Diff: chrome/renderer/resources/extensions/web_view/chrome_web_view.js

Issue 1039043003: Fix TODO in chrome_web_view, use utils.lookup to find context menu events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forgot to remove the second todo Created 5 years, 9 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: 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 a2ae068705488e1518ff5bb10b11a6381832ad72..f529114066a7b70d63ee706c8d19b7b3ae700dde 100644
--- a/chrome/renderer/resources/extensions/web_view/chrome_web_view.js
+++ b/chrome/renderer/resources/extensions/web_view/chrome_web_view.js
@@ -123,8 +123,8 @@ var WebViewContextMenus = Utils.expose(
WebViewImpl.prototype.maybeSetupContextMenus = function() {
if (!this.contextMenusOnContextMenuEvent_) {
var eventName = 'chromeWebViewInternal.onContextMenuShow';
- // TODO(lazyboy): Find event by name instead of events[1].
- var eventSchema = ChromeWebViewSchema.events[1];
+ var eventSchema =
+ Utils.lookup(ChromeWebViewSchema.events, 'name', 'onShow');
var eventOptions = {supportsListeners: true};
this.contextMenusOnContextMenuEvent_ = new ContextMenusOnContextMenuEvent(
this, eventName, eventSchema, eventOptions, this.viewInstanceId);
@@ -143,8 +143,8 @@ WebViewImpl.prototype.maybeSetupContextMenus = function() {
return function() {
if (!this.contextMenusOnClickedEvent_) {
var eventName = 'chromeWebViewInternal.onClicked';
- // TODO(lazyboy): Find event by name instead of events[0].
- var eventSchema = ChromeWebViewSchema.events[0];
+ var eventSchema =
+ Utils.lookup(ChromeWebViewSchema.events, 'name', 'onClicked');
var eventOptions = {supportsListeners: true};
var onClickedEvent = new ContextMenusOnClickedEvent(
eventName, eventSchema, eventOptions, this.viewInstanceId);
« 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