| 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 |
| 15 chromeHidden.Event.registerArgumentMassager('app.runtime.onLaunched', | 18 chromeHidden.Event.registerArgumentMassager('app.runtime.onLaunched', |
| 16 function(args, dispatch) { | 19 function(args, dispatch) { |
| 17 var launchData = args[0]; | 20 var launchData = args[0]; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 42 }, function(fileError) { | 45 }, function(fileError) { |
| 43 itemLoaded(fileError); | 46 itemLoaded(fileError); |
| 44 }); | 47 }); |
| 45 }); | 48 }); |
| 46 } else if (launchData) { | 49 } else if (launchData) { |
| 47 dispatch([launchData]); | 50 dispatch([launchData]); |
| 48 } else { | 51 } else { |
| 49 dispatch([]); | 52 dispatch([]); |
| 50 } | 53 } |
| 51 }); | 54 }); |
| 55 |
| 56 exports.binding = binding.generate(); |
| OLD | NEW |