Chromium Code Reviews| Index: chrome/browser/resources/file_manager/js/background.js |
| diff --git a/chrome/browser/resources/file_manager/js/background.js b/chrome/browser/resources/file_manager/js/background.js |
| index c5fad170ddef279be8ebe409a5becba612d1862e..e3384c84b3dc3222f2a70e916ba5d9b3ddab2e21 100644 |
| --- a/chrome/browser/resources/file_manager/js/background.js |
| +++ b/chrome/browser/resources/file_manager/js/background.js |
| @@ -390,7 +390,7 @@ function reopenFileManagers() { |
| * @param {Object} details Details object. |
| */ |
| function onExecute(action, details) { |
| - var urls = details.entries.map(function(e) { return e.toURL() }); |
| + var urls = details.entries.map(function(e) { return e.toURL(); }); |
| switch (action) { |
| case 'play': |
| @@ -402,25 +402,43 @@ function onExecute(action, details) { |
| break; |
| default: |
| - // Every other action opens a Files app window. |
| - var appState = { |
| - params: { |
| - action: action |
| - }, |
| - defaultPath: details.entries[0].fullPath, |
| - }; |
| - // For mounted devices just focus any Files.app window. The mounted |
| - // volume will appear on the navigation list. |
| - var type = action == 'auto-open' ? LaunchType.FOCUS_ANY_OR_CREATE : |
| - LaunchType.FOCUS_SAME_OR_CREATE; |
| - launchFileManager(appState, |
| - undefined, // App ID. |
| - type); |
| + var steps = new AsyncUtil.Queue(); |
| + var launchEnable = true; |
|
yoshiki
2013/09/09 08:16:54
nit: no need to set to true? I think either null o
hirono
2013/09/09 08:28:34
Done.
|
| + steps.run(function(nextStep) { |
| + if (action != 'auto-open') { |
|
yoshiki
2013/09/09 08:16:54
nit: Why we skip this step if 'auto-open'? Please
hirono
2013/09/09 08:28:34
Done.
|
| + nextStep(); |
| + return; |
| + } |
| + // If the disable-default-apps flag is on, Files.app is not opened |
| + // automatically on device mount because it obstculs the manual test. |
| + chrome.commandLinePrivate.hasSwitch('disable-default-apps', |
| + function(flag) { |
| + launchEnable = !flag; |
| + nextStep(); |
| + }); |
| + }); |
| + steps.run(function() { |
| + if (!launchEnable) |
| + return; |
|
yoshiki
2013/09/09 08:16:54
nit: add a blank line
hirono
2013/09/09 08:28:34
Done.
|
| + // Every other action opens a Files app window. |
| + var appState = { |
| + params: { |
| + action: action |
| + }, |
| + defaultPath: details.entries[0].fullPath |
| + }; |
| + // For mounted devices just focus any Files.app window. The mounted |
| + // volume will appear on the navigation list. |
| + var type = action == 'auto-open' ? LaunchType.FOCUS_ANY_OR_CREATE : |
| + LaunchType.FOCUS_SAME_OR_CREATE; |
| + launchFileManager(appState, |
| + undefined, // App ID. |
| + type); |
| + }); |
| break; |
| } |
| } |
| - |
| /** |
| * @return {Object} Audio player window create options. |
| */ |