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 chrome.app.runtime API. | 5 // Custom binding for the chrome.app.runtime API. |
6 | |
7 var binding = require('binding').Binding.create('app.runtime'); | |
6 | 8 |
7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); | 9 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); |
10 var chrome = requireNative('chrome').GetChrome(); | |
8 var fileSystemHelpers = requireNative('file_system_natives'); | 11 var fileSystemHelpers = requireNative('file_system_natives'); |
9 var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem; | 12 var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem; |
10 var appNatives = requireNative('app_runtime'); | 13 var appNatives = requireNative('app_runtime'); |
11 var DeserializeString = appNatives.DeserializeString; | 14 var DeserializeString = appNatives.DeserializeString; |
12 var SerializeToString = appNatives.SerializeToString; | 15 var SerializeToString = appNatives.SerializeToString; |
13 var CreateBlob = appNatives.CreateBlob; | 16 var CreateBlob = appNatives.CreateBlob; |
14 | 17 |
18 chrome.Event; | |
not at google - send to devlin
2013/02/13 01:45:49
?
cduvall
2013/02/15 00:40:28
Deleted.
| |
15 chromeHidden.Event.registerArgumentMassager('app.runtime.onLaunched', | 19 chromeHidden.Event.registerArgumentMassager('app.runtime.onLaunched', |
16 function(args, dispatch) { | 20 function(args, dispatch) { |
17 var launchData = args[0]; | 21 var launchData = args[0]; |
18 var intentData = args[1]; | 22 var intentData = args[1]; |
19 var intentId = args[2]; | 23 var intentId = args[2]; |
20 | 24 |
21 if (launchData && typeof launchData.id !== 'undefined') { | 25 if (launchData && typeof launchData.id !== 'undefined') { |
22 // new-style dispatch. | 26 // new-style dispatch. |
23 var items = [] | 27 var items = [] |
24 var numItems = launchData.items.length; | 28 var numItems = launchData.items.length; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 console.error('Unexpected launch data format'); | 114 console.error('Unexpected launch data format'); |
111 dispatch([]); | 115 dispatch([]); |
112 } | 116 } |
113 } else if (launchData) { | 117 } else if (launchData) { |
114 dispatch([launchData]); | 118 dispatch([launchData]); |
115 } else { | 119 } else { |
116 dispatch([]); | 120 dispatch([]); |
117 } | 121 } |
118 } | 122 } |
119 }); | 123 }); |
124 | |
125 exports.binding = binding.generate(); | |
OLD | NEW |