| Index: chrome/renderer/resources/extensions/extension_custom_bindings.js
|
| diff --git a/chrome/renderer/resources/extensions/extension_custom_bindings.js b/chrome/renderer/resources/extensions/extension_custom_bindings.js
|
| index 551e103258c7af5039b60282a85cced7eed8d184..be19e9c11b956ae421265991ab28c1f58ab4bf7e 100644
|
| --- a/chrome/renderer/resources/extensions/extension_custom_bindings.js
|
| +++ b/chrome/renderer/resources/extensions/extension_custom_bindings.js
|
| @@ -7,7 +7,6 @@
|
| var extensionNatives = requireNative('extension');
|
| var GetExtensionViews = extensionNatives.GetExtensionViews;
|
| var OpenChannelToExtension = extensionNatives.OpenChannelToExtension;
|
| -var OpenChannelToNativeApp = extensionNatives.OpenChannelToNativeApp;
|
|
|
| var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
|
|
|
| @@ -94,8 +93,6 @@ chromeHidden.registerCustomHook('extension',
|
| sendMessageUpdateArguments.bind(null, 'sendRequest'));
|
| apiFunctions.setUpdateArgumentsPreValidate('sendMessage',
|
| sendMessageUpdateArguments.bind(null, 'sendMessage'));
|
| - apiFunctions.setUpdateArgumentsPreValidate('sendNativeMessage',
|
| - sendMessageUpdateArguments.bind(null, 'sendNativeMessage'));
|
|
|
| apiFunctions.setHandleRequest('sendRequest',
|
| function(targetId, request, responseCallback) {
|
| @@ -111,13 +108,6 @@ chromeHidden.registerCustomHook('extension',
|
| chromeHidden.Port.sendMessageImpl(port, message, responseCallback);
|
| });
|
|
|
| - apiFunctions.setHandleRequest('sendNativeMessage',
|
| - function(targetId, message, responseCallback) {
|
| - var port = chrome.extension.connectNative(
|
| - targetId, message, chromeHidden.kNativeMessageChannel);
|
| - chromeHidden.Port.sendMessageImpl(port, '', responseCallback);
|
| - });
|
| -
|
| apiFunctions.setUpdateArgumentsPreValidate('connect', function() {
|
| // Align missing (optional) function arguments with the arguments that
|
| // schema validation is expecting, e.g.
|
| @@ -136,29 +126,10 @@ chromeHidden.registerCustomHook('extension',
|
| connectInfo = arguments[nextArg++];
|
|
|
| if (nextArg != arguments.length)
|
| - throw new Error('Invalid arguments to connect.');
|
| + throw new Error('Invalid arguments to connect');
|
| return [targetId, connectInfo];
|
| });
|
|
|
| - apiFunctions.setUpdateArgumentsPreValidate('connectNative', function() {
|
| - var nextArg = 0;
|
| -
|
| - // appName is required.
|
| - var appName = arguments[nextArg++];
|
| -
|
| - // connectionMessage is required.
|
| - var connectMessage = arguments[nextArg++];
|
| -
|
| - // channelName is only passed by sendMessage
|
| - var channelName = 'connectNative';
|
| - if (typeof(arguments[nextArg]) == 'string')
|
| - channelName = arguments[nextArg++];
|
| -
|
| - if (nextArg != arguments.length)
|
| - throw new Error('Invalid arguments to connectNative.');
|
| - return [appName, {name: channelName, message: connectMessage}];
|
| - });
|
| -
|
| apiFunctions.setHandleRequest('connect', function(targetId, connectInfo) {
|
| if (!targetId)
|
| targetId = extensionId;
|
| @@ -171,17 +142,4 @@ chromeHidden.registerCustomHook('extension',
|
| return chromeHidden.Port.createPort(portId, name);
|
| throw new Error('Error connecting to extension ' + targetId);
|
| });
|
| -
|
| - apiFunctions.setHandleRequest('connectNative',
|
| - function(nativeAppName, connectInfo) {
|
| - // Turn the object into a string here, because it eventually will be.
|
| - var portId = OpenChannelToNativeApp(extensionId,
|
| - nativeAppName,
|
| - connectInfo.name,
|
| - JSON.stringify(connectInfo.message));
|
| - if (portId >= 0) {
|
| - return chromeHidden.Port.createPort(portId, connectInfo.name);
|
| - }
|
| - throw new Error('Error connecting to native app: ' + nativeAppName);
|
| - });
|
| });
|
|
|