summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-23 19:43:00 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-23 19:43:00 +0000
commitd2cf63114443ab592bee4acaa04a431356a23cd8 (patch)
tree59ea6950dafc151d359d585b5243abf0eae1233d /chrome/installer
parent89c3317ba1adf8d974fc3b649ea6ac00ef6c0dae (diff)
downloadchromium_src-d2cf63114443ab592bee4acaa04a431356a23cd8.zip
chromium_src-d2cf63114443ab592bee4acaa04a431356a23cd8.tar.gz
chromium_src-d2cf63114443ab592bee4acaa04a431356a23cd8.tar.bz2
Toast experiment: I need to re-laucnh chrome because google_update likes setup to finish fast.
- Added new cmd line flag to setup.exe: --inactive-user-toast BUG= b/1484308 TEST = see the bug Review URL: http://codereview.chromium.org/144015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19044 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/setup/main.cc7
-rw-r--r--chrome/installer/util/browser_distribution.cc4
-rw-r--r--chrome/installer/util/browser_distribution.h4
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc24
-rw-r--r--chrome/installer/util/google_chrome_distribution.h5
-rw-r--r--chrome/installer/util/util_constants.cc5
-rw-r--r--chrome/installer/util/util_constants.h1
7 files changed, 42 insertions, 8 deletions
diff --git a/chrome/installer/setup/main.cc b/chrome/installer/setup/main.cc
index 752fa59..0a936ac 100644
--- a/chrome/installer/setup/main.cc
+++ b/chrome/installer/setup/main.cc
@@ -489,11 +489,11 @@ installer_util::InstallStatus ShowEULADialog(const std::wstring& inner_frame) {
bool HandleNonInstallCmdLineOptions(const CommandLine& cmd_line,
bool system_install,
int& exit_code) {
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution();
if (cmd_line.HasSwitch(installer_util::switches::kUpdateSetupExe)) {
// First to handle situation where the current process hangs or crashes,
// we pre-emptively set a flag in registry to get full installer next time.
installer_util::InstallStatus status = installer_util::SETUP_PATCH_FAILED;
- BrowserDistribution* dist = BrowserDistribution::GetDistribution();
dist->UpdateDiffInstallStatus(system_install, true, status);
// If --update-setup-exe command line option is given, we apply the given
@@ -593,8 +593,11 @@ bool HandleNonInstallCmdLineOptions(const CommandLine& cmd_line,
installer_setup::DeleteChromeRegistrationKeys(HKEY_LOCAL_MACHINE, tmp);
exit_code = tmp;
return true;
+ } else if (cmd_line.HasSwitch(installer_util::switches::kInactiveUserToast)) {
+ // Launch the inactive user toast experiment.
+ dist->InactiveUserToastExperiment();
+ return true;
}
-
return false;
}
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc
index 74416ad..ad31cba 100644
--- a/chrome/installer/util/browser_distribution.cc
+++ b/chrome/installer/util/browser_distribution.cc
@@ -90,3 +90,7 @@ void BrowserDistribution::LaunchUserExperiment(
installer_util::InstallStatus status, const installer::Version& version,
bool system_install, int options) {
}
+
+
+void BrowserDistribution::InactiveUserToastExperiment() {
+} \ No newline at end of file
diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h
index ece8960..26f9b3b 100644
--- a/chrome/installer/util/browser_distribution.h
+++ b/chrome/installer/util/browser_distribution.h
@@ -60,6 +60,10 @@ class BrowserDistribution {
const installer::Version& version,
bool system_install, int options);
+ // The user has qualified for the inactive user toast experiment and this
+ // function just performs it.
+ virtual void InactiveUserToastExperiment();
+
protected:
BrowserDistribution() {}
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index c75e475..359c7c7 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -92,6 +92,15 @@ int GetDirectoryWriteAgeInHours(const wchar_t* path) {
return (now_time - dir_time);
}
+// Launches again this same process with a single switch --|flag|. Does not
+// wait for the process to terminate.
+bool RelaunchSetup(const std::wstring& flag) {
+ CommandLine cmd_line(CommandLine::ForCurrentProcess()->program());
+ cmd_line.AppendSwitch(flag);
+ return base::LaunchApp(InstallUtil::GetChromeUninstallCmd(false),
+ false, false, NULL);
+}
+
} // namespace
bool GoogleChromeDistribution::BuildUninstallMetricsString(
@@ -423,6 +432,13 @@ void GoogleChromeDistribution::LaunchUserExperiment(
if (dir_age_hours < kNinetyDays)
return;
}
+ LOG(INFO) << "User qualified for toast experiment";
+ // The experiment needs to be performed in a different process because
+ // google_update expects the upgrade process to be quick and nimble.
+ RelaunchSetup(installer_util::switches::kInactiveUserToast);
+}
+
+void GoogleChromeDistribution::InactiveUserToastExperiment() {
// User qualifies for the experiment. Launch chrome with --try-chrome. Before
// that we need to change the client so we can track the progress.
if (!GoogleUpdateSettings::SetClient(kToastExpBaseGroup))
@@ -450,11 +466,9 @@ void GoogleChromeDistribution::LaunchUserExperiment(
GoogleUpdateSettings::SetClient(outcome);
if (outcome != kToastExpUninstallGroup)
return;
- // The user wants to uninstall. This is a best effort operation. While this
- // seems it could be a race (after all we are in the upgrade process) in
- // practice the user will be faced with a dialog which gives us plenty of
- // time to exit.
+ // The user wants to uninstall. This is a best effort operation. Note that
+ // we waited for chrome to exit so the uninstall would not detect chrome
+ // running.
base::LaunchApp(InstallUtil::GetChromeUninstallCmd(false),
false, false, NULL);
}
-
diff --git a/chrome/installer/util/google_chrome_distribution.h b/chrome/installer/util/google_chrome_distribution.h
index 9d41c33..f4b5016 100644
--- a/chrome/installer/util/google_chrome_distribution.h
+++ b/chrome/installer/util/google_chrome_distribution.h
@@ -82,6 +82,11 @@ class GoogleChromeDistribution : public BrowserDistribution {
const installer::Version& version,
bool system_install, int options);
+ // Assuming that the user qualifies, this function performs the inactive user
+ // toast experiment. It will use chrome to show the UI and it will record the
+ // outcome in the registry.
+ virtual void InactiveUserToastExperiment();
+
private:
friend class BrowserDistribution;
FRIEND_TEST(GoogleChromeDistributionTest, TestExtractUninstallMetrics);
diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc
index 8bb0e5a..99df51e 100644
--- a/chrome/installer/util/util_constants.cc
+++ b/chrome/installer/util/util_constants.cc
@@ -85,9 +85,12 @@ const wchar_t kVerboseLogging[] = L"verbose-logging";
// Show the embedded EULA dialog.
const wchar_t kShowEula[] = L"show-eula";
-// Use the alternate desktop shortcut name
+// Use the alternate desktop shortcut name.
const wchar_t kAltDesktopShortcut[] = L"alt-desktop-shortcut";
+// Perform the inactive user toast experiment.
+const wchar_t kInactiveUserToast[] = L"inactive-user-toast";
+
} // namespace switches
const wchar_t kInstallBinaryDir[] = L"Application";
diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h
index 671641b..7bc753f 100644
--- a/chrome/installer/util/util_constants.h
+++ b/chrome/installer/util/util_constants.h
@@ -90,6 +90,7 @@ extern const wchar_t kUpdateSetupExe[];
extern const wchar_t kVerboseLogging[];
extern const wchar_t kShowEula[];
extern const wchar_t kAltDesktopShortcut[];
+extern const wchar_t kInactiveUserToast[];
} // namespace switches
extern const wchar_t kInstallBinaryDir[];