summaryrefslogtreecommitdiffstats
path: root/chrome/browser/web_applications
diff options
context:
space:
mode:
authorhuangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-08 08:32:44 +0000
committerhuangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-08 08:32:44 +0000
commit3843d03d01479b21222802a62a5f7c5bd005f9ed (patch)
tree8b96d58b75ab86ae4c91206204045718d61eed7a /chrome/browser/web_applications
parent1bc2831891813f9cf9191c7d5deeccf246eff672 (diff)
downloadchromium_src-3843d03d01479b21222802a62a5f7c5bd005f9ed.zip
chromium_src-3843d03d01479b21222802a62a5f7c5bd005f9ed.tar.gz
chromium_src-3843d03d01479b21222802a62a5f7c5bd005f9ed.tar.bz2
Make application shortcuts point to app_host.exe, install App Host during app installation.
Platform apps need app_host.exe. 2 parts to this change are: (A) App shortcut now call "app_host.exe" instead of "chrome.exe". (B) On platform app install, check the presence of app_host.exe. If it's absent, call quick-enable-application-host to install app_host.exe. Wait for completion, then proceeding to install app. (B) should be executed in the FILE thread. However, some installation tasks may need to wait until quick-enable-application-host finishes (had CRX and unpacked app install in mind, but that's no longer the case). To avoid blocking the UI thread, we: - Create AppHostInstaller class, implementing EnsureAppHostInstalled(). - When (in AppShortcutManager::Observe) we want to ensure App Host is installed, we call the routine and specify a callback runction that takes a bool |success| flag. - AppHostInstaller handles the complexities of switching threads, checking presence of app_host.exe, grabs quick-enable-application-host command, calling it, listening to completion, and then notifies the caller via the callback. BUG=138319 TEST=install, then install an app. Verify App Host installed. Right-click on an app in NTP, create shortcut. Verify shortcut points to app_host.exe TBR=brettw Review URL: https://chromiumcodereview.appspot.com/11054006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/web_applications')
-rw-r--r--chrome/browser/web_applications/web_app_win.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc
index f1df116..352f921 100644
--- a/chrome/browser/web_applications/web_app_win.cc
+++ b/chrome/browser/web_applications/web_app_win.cc
@@ -16,6 +16,7 @@
#include "base/win/shortcut.h"
#include "base/win/windows_version.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/installer/launcher_support/chrome_launcher_support.h"
#include "content/public/browser/browser_thread.h"
#include "ui/gfx/icon_util.h"
@@ -224,12 +225,12 @@ bool CreatePlatformShortcuts(
return false;
}
- FilePath chrome_exe;
- if (!PathService::Get(base::FILE_EXE, &chrome_exe))
+ FilePath app_host_exe(chrome_launcher_support::GetAnyAppHostPath());
+ if (app_host_exe.empty())
return false;
// Working directory.
- FilePath chrome_folder(chrome_exe.DirName());
+ FilePath working_dir(app_host_exe.DirName());
CommandLine cmd_line(CommandLine::NO_PROGRAM);
cmd_line = ShellIntegration::CommandLineArgsForLauncher(shortcut_info.url,
@@ -268,8 +269,8 @@ bool CreatePlatformShortcuts(
}
base::win::ShortcutProperties shortcut_properties;
- shortcut_properties.set_target(chrome_exe);
- shortcut_properties.set_working_dir(chrome_folder);
+ shortcut_properties.set_target(app_host_exe);
+ shortcut_properties.set_working_dir(working_dir);
shortcut_properties.set_arguments(wide_switches);
shortcut_properties.set_description(description);
shortcut_properties.set_icon(icon_file, 0);