Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5367)

Unified Diff: chrome/installer/setup/setup_main.cc

Issue 2933043002: Installer support for Windows 10 inactive user toast. (Closed)
Patch Set: review feedback Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/setup/setup_constants.cc ('k') | chrome/installer/setup/user_experiment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/setup_main.cc
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 1e8df551a4042804beff3547b2a0194eea557a4f..064412f0bb8504e2a8a30d8341992cd2cc39ad0d 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -57,6 +57,7 @@
#include "chrome/installer/setup/setup_singleton.h"
#include "chrome/installer/setup/setup_util.h"
#include "chrome/installer/setup/uninstall.h"
+#include "chrome/installer/setup/user_experiment.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/delete_after_reboot_helper.h"
#include "chrome/installer/util/delete_old_versions.h"
@@ -871,13 +872,11 @@ bool HandleNonInstallCmdLineOptions(const base::FilePath& setup_exe,
// NOTE: Should the work done here, on kConfigureUserSettings, change:
// kActiveSetupVersion in install_worker.cc needs to be increased for Active
// Setup to invoke this again for all users of this install.
- const Product& chrome_install = installer_state->product();
installer::InstallStatus status = installer::INVALID_STATE_FOR_OPTION;
if (installer_state->system_install()) {
bool force =
cmd_line.HasSwitch(installer::switches::kForceConfigureUserSettings);
- installer::HandleActiveSetupForBrowser(installer_state->target_path(),
- chrome_install, force);
+ installer::HandleActiveSetupForBrowser(*installer_state, force);
status = installer::INSTALL_REPAIRED;
} else {
LOG(DFATAL)
@@ -979,6 +978,11 @@ bool HandleNonInstallCmdLineOptions(const base::FilePath& setup_exe,
<< setup_exe.value();
}
*exit_code = InstallUtil::GetInstallReturnCode(status);
+ } else if (cmd_line.HasSwitch(installer::switches::kUserExperiment)) {
+ installer::RunUserExperiment(cmd_line,
+ MasterPreferences::ForCurrentProcess(),
+ original_state, installer_state);
+ exit_code = 0;
} else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) {
// Launch the inactive user toast experiment.
int flavor = -1;
@@ -1480,6 +1484,15 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
InstallProducts(original_state, setup_exe, cmd_line, prefs,
&installer_state, &installer_directory);
DoLegacyCleanups(installer_state, install_status);
+
+ // It may be time to kick off an experiment if this was a successful update.
+ if ((install_status == installer::NEW_VERSION_UPDATED ||
+ install_status == installer::IN_USE_UPDATED) &&
+ installer::ShouldRunUserExperiment(installer_state)) {
+ installer::BeginUserExperiment(
+ installer_state, installer_directory.Append(setup_exe.BaseName()),
+ !system_install);
+ }
}
UMA_HISTOGRAM_ENUMERATION("Setup.Install.Result", install_status,
« no previous file with comments | « chrome/installer/setup/setup_constants.cc ('k') | chrome/installer/setup/user_experiment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698