| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Custom binding for the experimental offscreenTabs API. | 5 // Custom bindings for the experimental offscreenTabs API. |
| 6 | 6 |
| 7 var binding = require('binding').Binding.create('experimental.offscreenTabs'); | 7 (function() { |
| 8 | 8 |
| 9 binding.registerCustomHook( | 9 native function GetChromeHidden(); |
| 10 |
| 11 GetChromeHidden().registerCustomHook( |
| 10 'experimental.offscreenTabs', function(api) { | 12 'experimental.offscreenTabs', function(api) { |
| 11 var apiFunctions = api.apiFunctions; | 13 var apiFunctions = api.apiFunctions; |
| 12 | 14 |
| 13 function maybeCopy(src, prop, dest) { | 15 function maybeCopy(src, prop, dest) { |
| 14 if (src[prop] !== undefined) | 16 if (src[prop] !== undefined) |
| 15 dest[prop] = src[prop]; | 17 dest[prop] = src[prop]; |
| 16 }; | 18 }; |
| 17 | 19 |
| 18 function keyboardEventFilter(e) { | 20 function keyboardEventFilter(e) { |
| 19 var result = { | 21 var result = { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 53 } |
| 52 | 54 |
| 53 apiFunctions.setUpdateArgumentsPreValidate( | 55 apiFunctions.setUpdateArgumentsPreValidate( |
| 54 'sendKeyboardEvent', | 56 'sendKeyboardEvent', |
| 55 function() { return validate(arguments, keyboardEventFilter); }); | 57 function() { return validate(arguments, keyboardEventFilter); }); |
| 56 apiFunctions.setUpdateArgumentsPreValidate( | 58 apiFunctions.setUpdateArgumentsPreValidate( |
| 57 'sendMouseEvent', | 59 'sendMouseEvent', |
| 58 function() { return validate(arguments, mouseEventFilter); }); | 60 function() { return validate(arguments, mouseEventFilter); }); |
| 59 }); | 61 }); |
| 60 | 62 |
| 61 exports.binding = binding.generate(); | 63 })(); |
| OLD | NEW |