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

Unified Diff: chrome/installer/setup/user_experiment.h

Issue 2933043002: Installer support for Windows 10 inactive user toast. (Closed)
Patch Set: two studies 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
Index: chrome/installer/setup/user_experiment.h
diff --git a/chrome/installer/setup/user_experiment.h b/chrome/installer/setup/user_experiment.h
new file mode 100644
index 0000000000000000000000000000000000000000..60c74dc02c0c52bb58d62ef352ff557fdd39b99a
--- /dev/null
+++ b/chrome/installer/setup/user_experiment.h
@@ -0,0 +1,67 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_INSTALLER_SETUP_USER_EXPERIMENT_H_
+#define CHROME_INSTALLER_SETUP_USER_EXPERIMENT_H_
+
+#include "chrome/installer/util/experiment_metrics.h"
+#include "chrome/installer/util/experiment_storage.h"
+#include "chrome/installer/util/util_constants.h"
+
+namespace base {
+class CommandLine;
+class FilePath;
+} // namespace base
+
+namespace installer {
+
+class Experiment;
+class ExperimentStorage;
+class InstallationState;
+class InstallerState;
+class MasterPreferences;
+
+// Returns true if a user of this Chrome install should participate in a
+// post-update user experiment.
+bool ShouldRunUserExperiment();
+
+// Initiates the user experiment for a user of the current install. May only be
+// called if eligibility had previously been evaluated via
+// ShouldRunUserExperiment.
+void BeginUserExperiment(const InstallerState& installer_state,
+ const base::FilePath& setup_path);
+
+// Runs the experiment for the current user.
+void RunUserExperiment(const base::CommandLine& command_line,
+ const MasterPreferences& master_preferences,
+ InstallationState* original_state,
+ InstallerState* installer_state);
+
+// Writes the initial state |state| to the registry if there is no existing
+// state for this or another user.
+void WriteInitialState(ExperimentStorage* storage,
+ ExperimentMetrics::State state);
+
+// Returns true if the install is associated with an enterprise brand code.
+bool IsEnterpriseBrand();
+
+// Returns true if the machine is joined to a Windows domain.
+bool IsDomainJoined();
+
+// Returns true if the machine is selected for participation in |current_study|.
+// Dice are rolled on the first invocation to determine in which study the
+// machine participates.
+bool IsSelectedForStudy(ExperimentStorage::Lock* lock,
+ ExperimentStorage::Study current_study);
+
+// Returns a group number based on the study in which the client participates.
+int PickGroup(ExperimentStorage::Study participation);
+
+// Launches Chrome to present the prompt.
+void LaunchChrome(const InstallerState& installer_state,
+ const Experiment& experiment);
+
+} // namespace installer
+
+#endif // CHROME_INSTALLER_SETUP_USER_EXPERIMENT_H_

Powered by Google App Engine
This is Rietveld 408576698