| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // Implementation of custom bindings for the contextMenus API. | 5 // Implementation of custom bindings for the contextMenus API. |
| 6 // This is used to implement the contextMenus API for extensions and for the | 6 // This is used to implement the contextMenus API for extensions and for the |
| 7 // <webview> tag (see chrome_web_view_experimental.js). | 7 // <webview> tag (see chrome_web_view_experimental.js). |
| 8 | 8 |
| 9 var contextMenuNatives = requireNative('context_menus'); | 9 var contextMenuNatives = requireNative('context_menus'); |
| 10 var sendRequest = bindingUtil ? | 10 var sendRequest = bindingUtil ? |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 var optArgs = { | 180 var optArgs = { |
| 181 __proto__: null, | 181 __proto__: null, |
| 182 customCallback: getCallback($Function.bind(removeAllCallback, null, | 182 customCallback: getCallback($Function.bind(removeAllCallback, null, |
| 183 instanceId)), | 183 instanceId)), |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 var name = isWebview ? | 186 var name = isWebview ? |
| 187 'chromeWebViewInternal.contextMenusRemoveAll' : | 187 'chromeWebViewInternal.contextMenusRemoveAll' : |
| 188 'contextMenus.removeAll'; | 188 'contextMenus.removeAll'; |
| 189 sendRequest(name, $Array.from(arguments), | 189 sendRequest(name, $Array.from(arguments), |
| 190 this.definition.parameters, optArgs); | 190 bindingUtil ? undefined : this.definition.parameters, optArgs); |
| 191 }; | 191 }; |
| 192 | 192 |
| 193 return { | 193 return { |
| 194 requestHandlers: requestHandlers, | 194 requestHandlers: requestHandlers, |
| 195 }; | 195 }; |
| 196 } | 196 } |
| 197 | 197 |
| 198 exports.$set('create', createContextMenusHandlers); | 198 exports.$set('create', createContextMenusHandlers); |
| OLD | NEW |