Commit 260604e1 authored by Greg Thompson's avatar Greg Thompson Committed by Commit Bot

Fix browser registration for per-user dev and beta installs on Win7.

This change also makes the handling of the make_chrome_default and
make_chrome_default_for_user master preferences options conditional on a
brand's support for in-product default browser handling.

BUG=752007
R=pmonette@chromium.org

Change-Id: I1eb6d4344aa845943e726b69cf2319e6cf056cb9
Reviewed-on: https://chromium-review.googlesource.com/625896Reviewed-by: default avatarPatrick Monette <pmonette@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496600}
parent 1a7a344e
...@@ -452,7 +452,8 @@ void RegisterChromeOnMachine(const installer::InstallerState& installer_state, ...@@ -452,7 +452,8 @@ void RegisterChromeOnMachine(const installer::InstallerState& installer_state,
const base::FilePath chrome_exe( const base::FilePath chrome_exe(
installer_state.target_path().Append(installer::kChromeExe)); installer_state.target_path().Append(installer::kChromeExe));
VLOG(1) << "Registering Chrome as browser: " << chrome_exe.value(); VLOG(1) << "Registering Chrome as browser: " << chrome_exe.value();
if (make_chrome_default && ShellUtil::CanMakeChromeDefaultUnattended()) { if (make_chrome_default && install_static::SupportsSetAsDefaultBrowser() &&
ShellUtil::CanMakeChromeDefaultUnattended()) {
int level = ShellUtil::CURRENT_USER; int level = ShellUtil::CURRENT_USER;
if (installer_state.system_install()) if (installer_state.system_install())
level = level | ShellUtil::SYSTEM_LEVEL; level = level | ShellUtil::SYSTEM_LEVEL;
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/install_static/install_details.h" #include "chrome/install_static/install_details.h"
#include "chrome/install_static/install_util.h"
#include "chrome/installer/setup/archive_patch_helper.h" #include "chrome/installer/setup/archive_patch_helper.h"
#include "chrome/installer/setup/install.h" #include "chrome/installer/setup/install.h"
#include "chrome/installer/setup/install_worker.h" #include "chrome/installer/setup/install_worker.h"
...@@ -1396,21 +1397,26 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, ...@@ -1396,21 +1397,26 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
return installer::OS_ERROR; return installer::OS_ERROR;
} }
const install_static::InstallDetails& install_details =
install_static::InstallDetails::Get();
// Make sure system_level is supported if requested. For historical reasons, // Make sure system_level is supported if requested. For historical reasons,
// system-level installs have never been supported for Chrome canary (SxS). // system-level installs have never been supported for Chrome canary (SxS).
// This is a brand-specific policy for this particular mode. In general, // This is a brand-specific policy for this particular mode. In general,
// system-level installation of secondary install modes is fully supported. // system-level installation of secondary install modes is fully supported.
if (system_install && !install_details.supports_system_level()) if (!install_static::InstallDetails::Get().supports_system_level() &&
(system_install ||
cmd_line.HasSwitch(installer::switches::kSelfDestruct) ||
cmd_line.HasSwitch(installer::switches::kRemoveChromeRegistration))) {
return installer::SXS_OPTION_NOT_SUPPORTED; return installer::SXS_OPTION_NOT_SUPPORTED;
// Some command line options don't work with secondary installs. }
if (!install_details.is_primary_mode() && // Some switches only apply for modes that can be made the user's default
(cmd_line.HasSwitch(installer::switches::kSelfDestruct) || // browser.
cmd_line.HasSwitch(installer::switches::kMakeChromeDefault) || if (!install_static::SupportsSetAsDefaultBrowser() &&
cmd_line.HasSwitch(installer::switches::kRegisterChromeBrowser) || (cmd_line.HasSwitch(installer::switches::kMakeChromeDefault) ||
cmd_line.HasSwitch(installer::switches::kRemoveChromeRegistration) || cmd_line.HasSwitch(installer::switches::kRegisterChromeBrowser))) {
cmd_line.HasSwitch(installer::switches::kInactiveUserToast) || return installer::SXS_OPTION_NOT_SUPPORTED;
}
// Some switches only apply for modes that support retention experiments.
if (!install_static::SupportsRetentionExperiments() &&
(cmd_line.HasSwitch(installer::switches::kInactiveUserToast) ||
cmd_line.HasSwitch(installer::switches::kSystemLevelToast))) { cmd_line.HasSwitch(installer::switches::kSystemLevelToast))) {
return installer::SXS_OPTION_NOT_SUPPORTED; return installer::SXS_OPTION_NOT_SUPPORTED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment