diff options
Diffstat (limited to 'chrome/renderer/resources/extensions/page_actions_custom_bindings.js')
-rw-r--r-- | chrome/renderer/resources/extensions/page_actions_custom_bindings.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/chrome/renderer/resources/extensions/page_actions_custom_bindings.js b/chrome/renderer/resources/extensions/page_actions_custom_bindings.js index d5ec888..0b72e07 100644 --- a/chrome/renderer/resources/extensions/page_actions_custom_bindings.js +++ b/chrome/renderer/resources/extensions/page_actions_custom_bindings.js @@ -2,19 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Custom bindings for the pageActions API. +// Custom binding for the pageActions API. + +var binding = require('binding').Binding.create('pageActions'); var pageActionsNatives = requireNative('page_actions'); var GetCurrentPageActions = pageActionsNatives.GetCurrentPageActions; -var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); - -chromeHidden.registerCustomHook('pageActions', - function(bindingsAPI, extensionId) { +binding.registerCustomHook(function(bindingsAPI, extensionId) { var pageActions = GetCurrentPageActions(extensionId); + var pageActionsApi = bindingsAPI.compiledApi; var oldStyleEventName = 'pageActions'; for (var i = 0; i < pageActions.length; ++i) { // Setup events for each extension_id/page_action_id string we find. - chrome.pageActions[pageActions[i]] = new chrome.Event(oldStyleEventName); + pageActionsApi[pageActions[i]] = new chrome.Event(oldStyleEventName); } }); + +exports.binding = binding.generate(); |