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

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

Issue 2641863003: [Extensions Bindings] Add a messaging test (Closed)
Patch Set: . Created 3 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 the tabs API. 5 // Custom binding for the tabs API.
6 6
7 var binding = require('binding').Binding.create('tabs'); 7 var binding = apiBridge || require('binding').Binding.create('tabs');
8 8
9 var messaging = require('messaging'); 9 var messaging = require('messaging');
10 var OpenChannelToTab = requireNative('messaging_natives').OpenChannelToTab; 10 var OpenChannelToTab = requireNative('messaging_natives').OpenChannelToTab;
11 var sendRequestIsDisabled = requireNative('process').IsSendRequestDisabled(); 11 var sendRequestIsDisabled = requireNative('process').IsSendRequestDisabled();
12 var forEach = require('utils').forEach; 12 var forEach = require('utils').forEach;
13 13
14 binding.registerCustomHook(function(bindingsAPI, extensionId) { 14 binding.registerCustomHook(function(bindingsAPI, extensionId) {
15 var apiFunctions = bindingsAPI.apiFunctions; 15 var apiFunctions = bindingsAPI.apiFunctions;
16 var tabs = bindingsAPI.compiledApi; 16 var tabs = bindingsAPI.compiledApi;
17 17
(...skipping 27 matching lines...) Expand all
45 forEach(options, function(k, v) { 45 forEach(options, function(k, v) {
46 connectInfo[k] = v; 46 connectInfo[k] = v;
47 }); 47 });
48 } 48 }
49 49
50 var port = tabs.connect(tabId, connectInfo); 50 var port = tabs.connect(tabId, connectInfo);
51 messaging.sendMessageImpl(port, message, responseCallback); 51 messaging.sendMessageImpl(port, message, responseCallback);
52 }); 52 });
53 }); 53 });
54 54
55 exports.$set('binding', binding.generate()); 55 if (!apiBridge)
56 exports.$set('binding', binding.generate());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698