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