diff options
Diffstat (limited to 'chrome/installer/util/google_chrome_distribution.cc')
-rw-r--r-- | chrome/installer/util/google_chrome_distribution.cc | 24 |
1 files changed, 19 insertions, 5 deletions
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); } - |