diff options
author | huangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-11 20:27:06 +0000 |
---|---|---|
committer | huangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-11 20:27:06 +0000 |
commit | 830f16b43606a397965f64dcd8aa0df636ba07a4 (patch) | |
tree | 046d07d075b703a511bde03cc6f4616f306f8969 | |
parent | 9632bd99e1368a260f1cfde00fe656e2764ae047 (diff) | |
download | chromium_src-830f16b43606a397965f64dcd8aa0df636ba07a4.zip chromium_src-830f16b43606a397965f64dcd8aa0df636ba07a4.tar.gz chromium_src-830f16b43606a397965f64dcd8aa0df636ba07a4.tar.bz2 |
Fixing callers of BrowserDistribution::AppHostIsSupported().
To fix 164384, we want to make app_host.exe available for App Launcher only.
BrowserDistribution::AppHostIsSupported() means that the distribution can support app_host.exe. This holds for true for Chrome, and we're not changing this.
There are 3 callers for BrowserDistribution::AppHostIsSupported():
1. To display dialog box for App Launcher opt-in, given --enable-app-list-opt-in
2. To quick enable app_host.exe, when platform app is installed.
3. To set platform app shortcut executable to app_host.exe instead of chrome.exe.
The new behaviours are:
1. No change.
2. Do so only if user opts-in to App Launcher.
3. Do so only if App Launcher is installed.
Since 2 will be made faster, so we won't handle the race condition case (i.e., user opts-in, then quickly generate shortcut before app_host.exe appears(,
BUG=162418,164384
Review URL: https://chromiumcodereview.appspot.com/11488015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172391 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/extensions/app_host_installer_win.cc b/chrome/browser/extensions/app_host_installer_win.cc index a01c8ac..9153ddc 100644 --- a/chrome/browser/extensions/app_host_installer_win.cc +++ b/chrome/browser/extensions/app_host_installer_win.cc @@ -160,6 +160,10 @@ void AppHostInstaller::SetInstallWithLauncher( install_with_launcher_ = install_with_launcher; } +bool AppHostInstaller::GetInstallWithLauncher() { + return install_with_launcher_; +} + AppHostInstaller::AppHostInstaller( const OnAppHostInstallationCompleteCallback& completion_callback, BrowserThread::ID caller_thread_id) diff --git a/chrome/browser/extensions/app_host_installer_win.h b/chrome/browser/extensions/app_host_installer_win.h index 75e33fd..07bae82 100644 --- a/chrome/browser/extensions/app_host_installer_win.h +++ b/chrome/browser/extensions/app_host_installer_win.h @@ -35,6 +35,8 @@ class AppHostInstaller { static void SetInstallWithLauncher(bool install_with_launcher); + static bool GetInstallWithLauncher(); + private: // Constructs an AppHostInstaller, which will call |completion_callback| // on the specified thread upon installation completion. diff --git a/chrome/browser/extensions/app_shortcut_manager.cc b/chrome/browser/extensions/app_shortcut_manager.cc index 3e41462..e1ff3f83 100644 --- a/chrome/browser/extensions/app_shortcut_manager.cc +++ b/chrome/browser/extensions/app_shortcut_manager.cc @@ -91,7 +91,8 @@ void AppShortcutManager::Observe(int type, if (extension->is_platform_app() && extension->location() != Extension::COMPONENT) { #if defined(OS_WIN) - if (BrowserDistribution::GetDistribution()->AppHostIsSupported()) { + if (BrowserDistribution::GetDistribution()->AppHostIsSupported() && + extensions::AppHostInstaller::GetInstallWithLauncher()) { scoped_refptr<Extension> extension_ref(const_cast<Extension*>( extension)); extensions::AppHostInstaller::EnsureAppHostInstalled( diff --git a/chrome/browser/web_applications/web_app_win.cc b/chrome/browser/web_applications/web_app_win.cc index 776335a..9ccd7a7 100644 --- a/chrome/browser/web_applications/web_app_win.cc +++ b/chrome/browser/web_applications/web_app_win.cc @@ -188,8 +188,9 @@ bool CheckAndSaveIcon(const FilePath& icon_file, const SkBitmap& image) { FilePath GetShortcutExecutablePath( const ShellIntegration::ShortcutInfo& shortcut_info) { - if (BrowserDistribution::GetDistribution()->AppHostIsSupported() && - shortcut_info.is_platform_app) { + if (shortcut_info.is_platform_app && + BrowserDistribution::GetDistribution()->AppHostIsSupported() && + chrome_launcher_support::IsAppHostPresent()) { return chrome_launcher_support::GetAnyAppHostPath(); } |