OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 var binding = require('binding').Binding.create('chromeWebViewInternal'); | 5 var binding = require('binding').Binding.create('chromeWebViewInternal'); |
6 var contextMenusHandlers = require('contextMenusHandlers'); | 6 var contextMenusHandlers = require('contextMenusHandlers'); |
7 | 7 |
8 binding.registerCustomHook(function(bindingsAPI) { | 8 binding.registerCustomHook(function(bindingsAPI) { |
9 var apiFunctions = bindingsAPI.apiFunctions; | 9 var apiFunctions = bindingsAPI.apiFunctions; |
10 | 10 |
11 var handlers = contextMenusHandlers.create(true /* isWebview */); | 11 var handlers = contextMenusHandlers.create(true /* isWebview */); |
12 | 12 |
13 apiFunctions.setHandleRequest('contextMenusCreate', | 13 apiFunctions.setHandleRequest('contextMenusCreate', |
14 handlers.requestHandlers.create); | 14 handlers.requestHandlers.create); |
15 | 15 |
16 apiFunctions.setCustomCallback('contextMenusCreate', | 16 apiFunctions.setCustomCallback('contextMenusCreate', |
17 handlers.callbacks.create); | 17 handlers.callbacks.create); |
18 | 18 |
19 apiFunctions.setCustomCallback('contextMenusUpdate', | 19 apiFunctions.setCustomCallback('contextMenusUpdate', |
20 handlers.callbacks.update); | 20 handlers.callbacks.update); |
21 | 21 |
22 apiFunctions.setCustomCallback('contextMenusRemove', | 22 apiFunctions.setCustomCallback('contextMenusRemove', |
23 handlers.callbacks.remove); | 23 handlers.callbacks.remove); |
24 | 24 |
25 apiFunctions.setCustomCallback('contextMenusRemoveAll', | 25 apiFunctions.setCustomCallback('contextMenusRemoveAll', |
26 handlers.callbacks.removeAll); | 26 handlers.callbacks.removeAll); |
27 | 27 |
28 }); | 28 }); |
29 | 29 |
30 exports.ChromeWebView = binding.generate(); | 30 exports.$set('ChromeWebView', binding.generate()); |
OLD | NEW |