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

Side by Side Diff: chrome/renderer/resources/extensions/chrome_web_view_internal_custom_bindings.js

Issue 541753004: Split web_view_internal_api and move part of it to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Custom binding for <webview> contextMenus API. 5 // Custom binding for <webview> contextMenus API.
6 // Note that this file mimics custom bindings for chrome.contextMenus API 6 // Note that this file mimics custom bindings for chrome.contextMenus API
7 // which resides in context_menus_custom_bindings.js. The functions in this file 7 // which resides in context_menus_custom_bindings.js. The functions in this file
8 // have an extra instanceId parameter in the beginning, which corresponds to the 8 // have an extra instanceId parameter in the beginning, which corresponds to the
9 // id of the <webview>. 9 // id of the <webview>.
10 // 10 //
11 // TODO(lazyboy): Share common code /w context_menus_custom_bindings.js. 11 // TODO(lazyboy): Share common code /w context_menus_custom_bindings.js.
12 12
13 var EventBindings = require('event_bindings'); 13 var EventBindings = require('event_bindings');
14 var binding = require('binding').Binding.create('webViewInternal'); 14 var binding = require('binding').Binding.create('chromeWebViewInternal');
15 var contextMenuNatives = requireNative('context_menus'); 15 var contextMenuNatives = requireNative('context_menus');
16 var sendRequest = require('sendRequest').sendRequest; 16 var sendRequest = require('sendRequest').sendRequest;
17 17
18 binding.registerCustomHook(function(bindingsAPI) { 18 binding.registerCustomHook(function(bindingsAPI) {
19 var apiFunctions = bindingsAPI.apiFunctions; 19 var apiFunctions = bindingsAPI.apiFunctions;
20 20
21 var webviewContextMenus = {}; 21 var webviewContextMenus = {};
22 webviewContextMenus.generatedIdHandlers = {}; 22 webviewContextMenus.generatedIdHandlers = {};
23 webviewContextMenus.stringIdHandlers = {}; 23 webviewContextMenus.stringIdHandlers = {};
24 24
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (chrome.runtime.lastError) { 120 if (chrome.runtime.lastError) {
121 return; 121 return;
122 } 122 }
123 var instanceId = request.args[0]; 123 var instanceId = request.args[0];
124 webviewContextMenus.stringIdHandlers[instanceId] = {}; 124 webviewContextMenus.stringIdHandlers[instanceId] = {};
125 webviewContextMenus.generatedIdHandlers[instanceId] = {}; 125 webviewContextMenus.generatedIdHandlers[instanceId] = {};
126 }); 126 });
127 127
128 }); 128 });
129 129
130 exports.WebView = binding.generate(); 130 exports.ChromeWebView = binding.generate();
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.cc ('k') | chrome/renderer/resources/extensions/web_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698