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
);
26 exports
.binding
= binding
.generate();