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

Side by Side Diff: chrome/renderer/resources/extensions/app_runtime_custom_bindings.js

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments/TODOs Created 7 years, 11 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 chrome.app.runtime API. 5 // Custom bindings for the chrome.app.runtime API.
6 6
7 var bindings = new (require('schema_binding_generator').Bindings)(
8 'app.runtime');
9
7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 10 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
11 var chrome = requireNative('chrome').GetChrome();
8 var fileSystemHelpers = requireNative('file_system_natives'); 12 var fileSystemHelpers = requireNative('file_system_natives');
9 var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem; 13 var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem;
10 var appNatives = requireNative('app_runtime'); 14 var appNatives = requireNative('app_runtime');
11 var DeserializeString = appNatives.DeserializeString; 15 var DeserializeString = appNatives.DeserializeString;
12 var SerializeToString = appNatives.SerializeToString; 16 var SerializeToString = appNatives.SerializeToString;
13 var CreateBlob = appNatives.CreateBlob; 17 var CreateBlob = appNatives.CreateBlob;
14 18
19 chrome.Event;
15 chromeHidden.Event.registerArgumentMassager('app.runtime.onLaunched', 20 chromeHidden.Event.registerArgumentMassager('app.runtime.onLaunched',
16 function(args, dispatch) { 21 function(args, dispatch) {
17 var launchData = args[0]; 22 var launchData = args[0];
18 var intentData = args[1]; 23 var intentData = args[1];
19 var intentId = args[2]; 24 var intentId = args[2];
20 25
21 if (launchData && typeof launchData.id !== 'undefined') { 26 if (launchData && typeof launchData.id !== 'undefined') {
22 // new-style dispatch. 27 // new-style dispatch.
23 var items = [] 28 var items = []
24 var numItems = launchData.items.length; 29 var numItems = launchData.items.length;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 console.error('Unexpected launch data format'); 115 console.error('Unexpected launch data format');
111 dispatch([]); 116 dispatch([]);
112 } 117 }
113 } else if (launchData) { 118 } else if (launchData) {
114 dispatch([launchData]); 119 dispatch([launchData]);
115 } else { 120 } else {
116 dispatch([]); 121 dispatch([]);
117 } 122 }
118 } 123 }
119 }); 124 });
125
126 exports.bindings = bindings.generate();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698