Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / extensions / renderer / resources / context_menus_custom_bindings.js
blobfe5cec9e792de5904e24655a4fd8de2e196dea9a
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 // Custom binding for the contextMenus API.
7 var binding = require('binding').Binding.create('contextMenus');
8 var contextMenusHandlers = require('contextMenusHandlers');
10 binding.registerCustomHook(function(bindingsAPI) {
11   var apiFunctions = bindingsAPI.apiFunctions;
13   var handlers = contextMenusHandlers.create(false /* isWebview */);
15   apiFunctions.setHandleRequest('create', handlers.requestHandlers.create);
17   apiFunctions.setCustomCallback('create', handlers.callbacks.create);
19   apiFunctions.setCustomCallback('remove', handlers.callbacks.remove);
21   apiFunctions.setCustomCallback('update', handlers.callbacks.update);
23   apiFunctions.setCustomCallback('removeAll', handlers.callbacks.removeAll);
24 });
26 exports.binding = binding.generate();