| Index: chrome/browser/web_applications/web_app_mac.mm
|
| diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
|
| index dee408337729cd8d6a0e84b1784969ea04a06d15..cac8dc9f7896335a1fb70d5f9abdb004205dde4c 100644
|
| --- a/chrome/browser/web_applications/web_app_mac.mm
|
| +++ b/chrome/browser/web_applications/web_app_mac.mm
|
| @@ -6,16 +6,19 @@
|
|
|
| #import <Cocoa/Cocoa.h>
|
|
|
| +#include "base/command_line.h"
|
| #include "base/file_util.h"
|
| #include "base/files/scoped_temp_dir.h"
|
| #include "base/mac/bundle_locations.h"
|
| #include "base/mac/foundation_util.h"
|
| +#include "base/mac/launch_services_util.h"
|
| #include "base/mac/mac_logging.h"
|
| #include "base/mac/mac_util.h"
|
| #include "base/mac/scoped_cftyperef.h"
|
| #include "base/memory/scoped_nsobject.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| #include "base/utf_string_conversions.h"
|
| +#include "chrome/browser/ui/web_applications/web_app_ui.h"
|
| #include "chrome/browser/web_applications/web_app.h"
|
| #include "chrome/common/chrome_paths_internal.h"
|
| #include "chrome/common/mac/app_mode_common.h"
|
| @@ -288,6 +291,18 @@ void WebAppShortcutCreator::RevealGeneratedBundleInFinder(
|
| inFileViewerRootedAtPath:nil];
|
| }
|
|
|
| +void LaunchShimOnFileThread(
|
| + const ShellIntegration::ShortcutInfo& shortcut_info) {
|
| + DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
|
| + base::FilePath shim_path = web_app::GetAppInstallPath(shortcut_info);
|
| + if (shim_path.empty())
|
| + return;
|
| +
|
| + CommandLine command_line(CommandLine::NO_PROGRAM);
|
| + command_line.AppendSwitch(app_mode::kNoLaunchApp);
|
| + base::mac::OpenApplicationWithPath(shim_path, command_line, NULL);
|
| +}
|
| +
|
| } // namespace
|
|
|
| namespace web_app {
|
| @@ -300,6 +315,12 @@ base::FilePath GetAppInstallPath(
|
| return shortcut_creator.GetShortcutPath();
|
| }
|
|
|
| +void MaybeLaunchShortcut(const ShellIntegration::ShortcutInfo& shortcut_info) {
|
| + content::BrowserThread::PostTask(
|
| + content::BrowserThread::FILE, FROM_HERE,
|
| + base::Bind(&LaunchShimOnFileThread, shortcut_info));
|
| +}
|
| +
|
| namespace internals {
|
|
|
| base::FilePath GetAppBundleByExtensionId(std::string extension_id) {
|
|
|