| 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 binding for the chrome.app.runtime API. | 5 // Custom bindings for the chrome.app.runtime API. |
| 6 | |
| 7 var binding = require('binding').Binding.create('app.runtime'); | |
| 8 | 6 |
| 9 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); | 7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); |
| 10 var chrome = requireNative('chrome').GetChrome(); | |
| 11 var fileSystemHelpers = requireNative('file_system_natives'); | 8 var fileSystemHelpers = requireNative('file_system_natives'); |
| 12 var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem; | 9 var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem; |
| 13 var appNatives = requireNative('app_runtime'); | 10 var appNatives = requireNative('app_runtime'); |
| 14 var DeserializeString = appNatives.DeserializeString; | 11 var DeserializeString = appNatives.DeserializeString; |
| 15 var SerializeToString = appNatives.SerializeToString; | 12 var SerializeToString = appNatives.SerializeToString; |
| 16 var CreateBlob = appNatives.CreateBlob; | 13 var CreateBlob = appNatives.CreateBlob; |
| 17 | 14 |
| 18 chromeHidden.Event.registerArgumentMassager('app.runtime.onLaunched', | 15 chromeHidden.Event.registerArgumentMassager('app.runtime.onLaunched', |
| 19 function(args, dispatch) { | 16 function(args, dispatch) { |
| 20 var launchData = args[0]; | 17 var launchData = args[0]; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 45 }, function(fileError) { | 42 }, function(fileError) { |
| 46 itemLoaded(fileError); | 43 itemLoaded(fileError); |
| 47 }); | 44 }); |
| 48 }); | 45 }); |
| 49 } else if (launchData) { | 46 } else if (launchData) { |
| 50 dispatch([launchData]); | 47 dispatch([launchData]); |
| 51 } else { | 48 } else { |
| 52 dispatch([]); | 49 dispatch([]); |
| 53 } | 50 } |
| 54 }); | 51 }); |
| 55 | |
| 56 exports.binding = binding.generate(); | |
| OLD | NEW |