Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / chrome / renderer / resources / extensions / chrome_web_view.js
blob34bd97586f81a72acacecc74aea9b56426b0dff6
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This module implements chrome-specific <webview> API.
7 var ChromeWebView = require('chromeWebViewInternal').ChromeWebView;
8 var CreateEvent = require('webViewEvents').CreateEvent;
9 var EventBindings = require('event_bindings');
10 var WebViewImpl = require('webView').WebViewImpl;
12 var CHROME_WEB_VIEW_EVENTS = {
13 'contextmenu': {
14 evt: CreateEvent('chromeWebViewInternal.contextmenu'),
15 cancelable: true,
16 customHandler: function(handler, event, webViewEvent) {
17 handler.webViewImpl.maybeHandleContextMenu(event, webViewEvent);
19 fields: ['items']
23 /**
24 * Implemented when the ChromeWebView API is available.
25 * @private
27 WebViewImpl.prototype.maybeGetChromeWebViewEvents = function() {
28 return CHROME_WEB_VIEW_EVENTS;
31 /**
32 * Calls to show contextmenu right away instead of dispatching a 'contextmenu'
33 * event.
34 * This will be overridden in chrome_web_view_experimental.js to implement
35 * contextmenu API.
37 WebViewImpl.prototype.maybeHandleContextMenu = function(e, webViewEvent) {
38 var requestId = e.requestId;
39 // Setting |params| = undefined will show the context menu unmodified, hence
40 // the 'contextmenu' API is disabled for stable channel.
41 var params = undefined;
42 ChromeWebView.showContextMenu(this.guestInstanceId, requestId, params);