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

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

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compilation Created 7 years, 9 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 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
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();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698