summaryrefslogtreecommitdiffstats
path: root/extensions/renderer
diff options
context:
space:
mode:
authorcmihail <cmihail@chromium.org>2016-02-24 18:15:21 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-25 02:16:28 +0000
commit20232c23c12a81d98b69d10c9e18c0b4292606cb (patch)
tree669678e9e8b9e74461c8d963710f64018f04b277 /extensions/renderer
parent3d3507bd86994743e974e04ecfc97db4f640a007 (diff)
downloadchromium_src-20232c23c12a81d98b69d10c9e18c0b4292606cb.zip
chromium_src-20232c23c12a81d98b69d10c9e18c0b4292606cb.tar.gz
chromium_src-20232c23c12a81d98b69d10c9e18c0b4292606cb.tar.bz2
Add directories handling support for apps/extensions.
The change introduces a "include_directories" entry in the manifest file for file_handlers. In case the value is true, the file handler becomes a generic handler and adds the given extension to the right click menu. BUG=415897 R=mtomasz@chromium.org Review URL: https://codereview.chromium.org/1407473003 Cr-Commit-Position: refs/heads/master@{#377467}
Diffstat (limited to 'extensions/renderer')
-rw-r--r--extensions/renderer/resources/app_runtime_custom_bindings.js21
1 files changed, 15 insertions, 6 deletions
diff --git a/extensions/renderer/resources/app_runtime_custom_bindings.js b/extensions/renderer/resources/app_runtime_custom_bindings.js
index 0364b66..3f0dbd2 100644
--- a/extensions/renderer/resources/app_runtime_custom_bindings.js
+++ b/extensions/renderer/resources/app_runtime_custom_bindings.js
@@ -57,12 +57,21 @@ eventBindings.registerArgumentMassager('app.runtime.onLaunched',
};
$Array.forEach(launchData.items, function(item) {
var fs = GetIsolatedFileSystem(item.fileSystemId);
- fs.root.getFile(item.baseName, {}, function(fileEntry) {
- entryIdManager.registerEntry(item.entryId, fileEntry);
- itemLoaded(null, { entry: fileEntry, type: item.mimeType });
- }, function(fileError) {
- itemLoaded(fileError);
- });
+ if (item.isDirectory) {
+ fs.root.getDirectory(item.baseName, {}, function(dirEntry) {
+ entryIdManager.registerEntry(item.entryId, dirEntry);
+ itemLoaded(null, {entry: dirEntry});
+ }, function(fileError) {
+ itemLoaded(fileError);
+ });
+ } else {
+ fs.root.getFile(item.baseName, {}, function(fileEntry) {
+ entryIdManager.registerEntry(item.entryId, fileEntry);
+ itemLoaded(null, {entry: fileEntry, type: item.mimeType});
+ }, function(fileError) {
+ itemLoaded(fileError);
+ });
+ }
});
} else {
// Default case. This currently covers an onLaunched corresponding to