Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: chrome/renderer/resources/extensions/experimental.offscreenTabs_custom_bindings.js

Issue 17451011: Make the externally connectable browser test clobber all of the builtins, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 binding for the experimental offscreenTabs API.
6 6
7 var binding = require('binding').Binding.create('experimental.offscreenTabs'); 7 var binding = require('binding').Binding.create('experimental.offscreenTabs');
8 8
9 binding.registerCustomHook( 9 binding.registerCustomHook(
10 'experimental.offscreenTabs', function(api) { 10 'experimental.offscreenTabs', function(api) {
(...skipping 27 matching lines...) Expand all
38 button: e.button, 38 button: e.button,
39 }; 39 };
40 maybeCopy(e, 'wheelDeltaX', result); 40 maybeCopy(e, 'wheelDeltaX', result);
41 maybeCopy(e, 'wheelDeltaY', result); 41 maybeCopy(e, 'wheelDeltaY', result);
42 return result; 42 return result;
43 }; 43 };
44 44
45 // We are making a copy of |arr|, but applying |func| to index 1. 45 // We are making a copy of |arr|, but applying |func| to index 1.
46 function validate(arr, func) { 46 function validate(arr, func) {
47 var newArr = []; 47 var newArr = [];
48 for (var i = 0; i < arr.length; i++) 48 for (var i = 0; i < arr.length; i++) {
49 newArr.push(i == 1 && typeof(arr) == 'object' ? func(arr[i]) : arr[i]); 49 $Array.push(newArr,
50 i == 1 && typeof(arr) == 'object' ? func(arr[i]) : arr[i]);
51 }
50 return newArr; 52 return newArr;
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 exports.binding = binding.generate();
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/event.js ('k') | chrome/renderer/resources/extensions/extension_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698