diff options
author | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 00:21:56 +0000 |
---|---|---|
committer | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 00:21:56 +0000 |
commit | 1450fc16be18fdf721e7a2c7c7a43d535c89bde5 (patch) | |
tree | c1ce82ec0e906ac6bc526e41fb69ff36ef5d08c7 /chrome/installer | |
parent | 34d14848d6b9c5613e4a1a882898f50c7ab39983 (diff) | |
download | chromium_src-1450fc16be18fdf721e7a2c7c7a43d535c89bde5.zip chromium_src-1450fc16be18fdf721e7a2c7c7a43d535c89bde5.tar.gz chromium_src-1450fc16be18fdf721e7a2c7c7a43d535c89bde5.tar.bz2 |
Allow download Chrome page to set Chrome as default even if it is not a new install.
Read "make_default_for_user" preference from master_preferences file and set Chrome to default in installer if we are updating Chrome instead of installing a new version.
The problem here is that now that we set the default browser preference from a web page, we are using master_preferences to communicate this desire to the browser.
Because the user already has Chrome installed on his/her machine, the master_preferences file will not be written to their machine.
Instead, we check for this preference in the installer itself, and set Chrome to be default for the user here.
BUG=53656
TEST=Have Chrome installed on your machine, but *not* default browser. Run setup.exe to install a new version of Chrome, with a master_preferences file that includes the distribution preference "make_default_for_user":true. (This reflects what happens when the user downloads Chrome with the "make default" option checked).
Chrome should be default browser.
Review URL: http://codereview.chromium.org/3342002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58280 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/setup/install.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc index f2d2e60..d11a51a 100644 --- a/chrome/installer/setup/install.cc +++ b/chrome/installer/setup/install.cc @@ -773,8 +773,21 @@ installer_util::InstallStatus installer::InstallOrUpdateChrome( installer_util::GetDistroBooleanPreference(prefs, installer_util::master_preferences::kMakeChromeDefault, &make_chrome_default); + + // If this is not the user's first Chrome install, but they have chosen + // Chrome to become their default browser on the download page, we must + // force it here because the master_preferences file will not get copied + // into the build. + bool force_chrome_default_for_user = false; + if (result == installer_util::NEW_VERSION_UPDATED || + result == installer_util::INSTALL_REPAIRED) { + installer_util::GetDistroBooleanPreference(prefs, + installer_util::master_preferences::kMakeChromeDefaultForUser, + &force_chrome_default_for_user); + } + RegisterChromeOnMachine(install_path, system_install, - make_chrome_default); + make_chrome_default || force_chrome_default_for_user); } std::wstring latest_version_to_keep(new_version.GetString()); |