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