| 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 binding for the chrome.app.runtime API. |
| 6 | 6 |
| 7 var binding = require('binding').Binding.create('app.runtime'); | 7 var binding = require('binding').Binding.create('app.runtime'); |
| 8 | 8 |
| 9 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); | 9 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); |
| 10 var chrome = requireNative('chrome').GetChrome(); | 10 var chrome = requireNative('chrome').GetChrome(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 dispatch([]); | 67 dispatch([]); |
| 68 } else { | 68 } else { |
| 69 var data = { id: launchData.id, items: items }; | 69 var data = { id: launchData.id, items: items }; |
| 70 dispatch([data]); | 70 dispatch([data]); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 }; | 73 }; |
| 74 forEach(launchData.items, function(i, item) { | 74 forEach(launchData.items, function(i, item) { |
| 75 var fs = GetIsolatedFileSystem(item.fileSystemId); | 75 var fs = GetIsolatedFileSystem(item.fileSystemId); |
| 76 fs.root.getFile(item.baseName, {}, function(fileEntry) { | 76 fs.root.getFile(item.baseName, {}, function(fileEntry) { |
| 77 entryIdManager.registerEntry(item.entryId, fileEntry); |
| 77 itemLoaded(null, { entry: fileEntry, type: item.mimeType }); | 78 itemLoaded(null, { entry: fileEntry, type: item.mimeType }); |
| 78 }, function(fileError) { | 79 }, function(fileError) { |
| 79 itemLoaded(fileError); | 80 itemLoaded(fileError); |
| 80 }); | 81 }); |
| 81 }); | 82 }); |
| 82 } else if (launchData) { | 83 } else if (launchData) { |
| 83 dispatch([launchData]); | 84 dispatch([launchData]); |
| 84 } else { | 85 } else { |
| 85 dispatch([]); | 86 dispatch([]); |
| 86 } | 87 } |
| 87 }); | 88 }); |
| 88 | 89 |
| 89 exports.binding = binding.generate(); | 90 exports.binding = binding.generate(); |
| OLD | NEW |