context_menus_custom_bindings.js 792 B

12345678910111213141516171819202122
  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.
  4. // Custom binding for the contextMenus API.
  5. var contextMenusHandlers = require('contextMenusHandlers');
  6. apiBridge.registerCustomHook(function(bindingsAPI) {
  7. var apiFunctions = bindingsAPI.apiFunctions;
  8. var handlers = contextMenusHandlers.create(false /* isWebview */);
  9. apiFunctions.setHandleRequest('create', handlers.requestHandlers.create);
  10. apiFunctions.setHandleRequest('remove', handlers.requestHandlers.remove);
  11. apiFunctions.setHandleRequest('update', handlers.requestHandlers.update);
  12. apiFunctions.setHandleRequest('removeAll',
  13. handlers.requestHandlers.removeAll);
  14. });