summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util
diff options
context:
space:
mode:
authorgrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-17 16:30:06 +0000
committergrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-17 16:30:06 +0000
commit69fbc3692896a7f47d4bd42a2f6c611bfcfa8c8a (patch)
tree18e55e4b6c3db5253d9c62670f665ad7c8435433 /chrome/installer/util
parent4e3c45580eebf8cf5a99eb0d5f999f455a7f8b5d (diff)
downloadchromium_src-69fbc3692896a7f47d4bd42a2f6c611bfcfa8c8a.zip
chromium_src-69fbc3692896a7f47d4bd42a2f6c611bfcfa8c8a.tar.gz
chromium_src-69fbc3692896a7f47d4bd42a2f6c611bfcfa8c8a.tar.bz2
Fix toast experiments, which had regressed.
BUG=76400 TEST=Try out the toast experiment, both at user- and system-level. Review URL: http://codereview.chromium.org/6670087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util')
-rw-r--r--chrome/installer/util/browser_distribution.cc5
-rw-r--r--chrome/installer/util/browser_distribution.h3
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc28
-rw-r--r--chrome/installer/util/google_chrome_distribution.h3
-rw-r--r--chrome/installer/util/google_chrome_distribution_dummy.cc5
5 files changed, 25 insertions, 19 deletions
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc
index 251dd7e..95c0139 100644
--- a/chrome/installer/util/browser_distribution.cc
+++ b/chrome/installer/util/browser_distribution.cc
@@ -221,8 +221,9 @@ void BrowserDistribution::UpdateInstallStatus(bool system_install,
}
void BrowserDistribution::LaunchUserExperiment(
- installer::InstallStatus status, const Version& version,
- const installer::Product& installation, bool system_level) {
+ const FilePath& setup_path, installer::InstallStatus status,
+ const Version& version, const installer::Product& installation,
+ bool system_level) {
}
diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h
index 6c0df20..c20888b 100644
--- a/chrome/installer/util/browser_distribution.h
+++ b/chrome/installer/util/browser_distribution.h
@@ -98,7 +98,8 @@ class BrowserDistribution {
// After an install or upgrade the user might qualify to participate in an
// experiment. This function determines if the user qualifies and if so it
// sets the wheels in motion or in simple cases does the experiment itself.
- virtual void LaunchUserExperiment(installer::InstallStatus status,
+ virtual void LaunchUserExperiment(const FilePath& setup_path,
+ installer::InstallStatus status,
const Version& version, const installer::Product& installation,
bool system_level);
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index 9f41a03..a089735 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -130,13 +130,13 @@ int GetDirectoryWriteAgeInHours(const wchar_t* path) {
return (now_time - dir_time);
}
-// Launches again this same process with switch --|flag|=|value|.
+// Launches setup.exe (located at |setup_path|) with switch --|flag|=|value|.
// If system_level_toast is true, appends --system-level-toast.
// If handle to experiment result key was given at startup, re-add it.
// Does not wait for the process to terminate.
-bool RelaunchSetup(const std::string& flag, int value,
- bool system_level_toast) {
- CommandLine new_cmd_line(CommandLine::ForCurrentProcess()->GetProgram());
+bool LaunchSetup(const FilePath& setup_path, const std::string& flag,
+ int value, bool system_level_toast) {
+ CommandLine new_cmd_line(setup_path);
new_cmd_line.AppendSwitchASCII(flag, base::IntToString(value));
// Re-add the system level toast flag.
@@ -221,9 +221,9 @@ bool FixDACLsForExecute(const FilePath& exe) {
// the computer is on but nobody has logged in locally.
// Remote Desktop sessions do not count as interactive sessions; running this
// method as a user logged in via remote desktop will do nothing.
-bool RelaunchSetupAsConsoleUser(const std::string& flag) {
- FilePath setup_exe = CommandLine::ForCurrentProcess()->GetProgram();
- CommandLine cmd_line(setup_exe);
+bool LaunchSetupAsConsoleUser(const FilePath& setup_path,
+ const std::string& flag) {
+ CommandLine cmd_line(setup_path);
cmd_line.AppendSwitch(flag);
// Get the Google Update results key, and pass it on the command line to
@@ -235,7 +235,7 @@ bool RelaunchSetupAsConsoleUser(const std::string& flag) {
if (base::win::GetVersion() > base::win::VERSION_XP) {
// Make sure that in Vista and Above we have the proper DACLs so
// the interactive user can launch it.
- if (!FixDACLsForExecute(setup_exe))
+ if (!FixDACLsForExecute(setup_path))
NOTREACHED();
}
@@ -557,12 +557,14 @@ void SetClient(std::wstring experiment_group, bool last_write) {
// 3- It has been re-launched from the #2 case. In this case we enter
// this function with |system_install| true and a REENTRY_SYS_UPDATE status.
void GoogleChromeDistribution::LaunchUserExperiment(
- installer::InstallStatus status, const Version& version,
- const installer::Product& installation, bool system_level) {
+ const FilePath& setup_path, installer::InstallStatus status,
+ const Version& version, const installer::Product& installation,
+ bool system_level) {
if (system_level) {
if (installer::NEW_VERSION_UPDATED == status) {
// We need to relaunch as the interactive user.
- RelaunchSetupAsConsoleUser(installer::switches::kSystemLevelToast);
+ LaunchSetupAsConsoleUser(setup_path,
+ installer::switches::kSystemLevelToast);
return;
}
} else {
@@ -630,8 +632,8 @@ void GoogleChromeDistribution::LaunchUserExperiment(
// because google_update expects the upgrade process to be quick and nimble.
// System level: We have already been relaunched, so we don't need to be
// quick, but we relaunch to follow the exact same codepath.
- RelaunchSetup(installer::switches::kInactiveUserToast, flavor,
- system_level);
+ LaunchSetup(setup_path, installer::switches::kInactiveUserToast, flavor,
+ system_level);
}
// User qualifies for the experiment. Launch chrome with --try-chrome=flavor.
diff --git a/chrome/installer/util/google_chrome_distribution.h b/chrome/installer/util/google_chrome_distribution.h
index ac4a3d1..3dc3b88 100644
--- a/chrome/installer/util/google_chrome_distribution.h
+++ b/chrome/installer/util/google_chrome_distribution.h
@@ -70,7 +70,8 @@ class GoogleChromeDistribution : public BrowserDistribution {
installer::ArchiveType archive_type,
installer::InstallStatus install_status);
- virtual void LaunchUserExperiment(installer::InstallStatus status,
+ virtual void LaunchUserExperiment(const FilePath& setup_path,
+ installer::InstallStatus status,
const Version& version,
const installer::Product& installation,
bool system_level);
diff --git a/chrome/installer/util/google_chrome_distribution_dummy.cc b/chrome/installer/util/google_chrome_distribution_dummy.cc
index 28340bd..cac5d1b 100644
--- a/chrome/installer/util/google_chrome_distribution_dummy.cc
+++ b/chrome/installer/util/google_chrome_distribution_dummy.cc
@@ -107,8 +107,9 @@ void GoogleChromeDistribution::UpdateInstallStatus(bool system_install,
}
void GoogleChromeDistribution::LaunchUserExperiment(
- installer::InstallStatus status, const Version& version,
- const installer::Product& installation, bool system_level) {
+ const FilePath& setup_path, installer::InstallStatus status,
+ const Version& version, const installer::Product& installation,
+ bool system_level) {
NOTREACHED();
}