OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_INSTALLER_SETUP_USER_EXPERIMENT_H_ |
| 6 #define CHROME_INSTALLER_SETUP_USER_EXPERIMENT_H_ |
| 7 |
| 8 #include "chrome/installer/util/experiment_metrics.h" |
| 9 #include "chrome/installer/util/experiment_storage.h" |
| 10 #include "chrome/installer/util/util_constants.h" |
| 11 |
| 12 namespace base { |
| 13 class CommandLine; |
| 14 class FilePath; |
| 15 } // namespace base |
| 16 |
| 17 namespace installer { |
| 18 |
| 19 class Experiment; |
| 20 class ExperimentStorage; |
| 21 class InstallationState; |
| 22 class InstallerState; |
| 23 class MasterPreferences; |
| 24 |
| 25 // Returns true if a user of this Chrome install should participate in a |
| 26 // post-update user experiment. |
| 27 bool ShouldRunUserExperiment(); |
| 28 |
| 29 // Initiates the user experiment for a user of the current install. May only be |
| 30 // called if eligibility had previously been evaluated via |
| 31 // ShouldRunUserExperiment. |
| 32 void BeginUserExperiment(const InstallerState& installer_state, |
| 33 const base::FilePath& setup_path); |
| 34 |
| 35 // Runs the experiment for the current user. |
| 36 void RunUserExperiment(const base::CommandLine& command_line, |
| 37 const MasterPreferences& master_preferences, |
| 38 InstallationState* original_state, |
| 39 InstallerState* installer_state); |
| 40 |
| 41 // Writes the initial state |state| to the registry if there is no existing |
| 42 // state for this or another user. |
| 43 void WriteInitialState(ExperimentStorage* storage, |
| 44 ExperimentMetrics::State state); |
| 45 |
| 46 // Returns true if the install is associated with an enterprise brand code. |
| 47 bool IsEnterpriseBrand(); |
| 48 |
| 49 // Returns true if the machine is joined to a Windows domain. |
| 50 bool IsDomainJoined(); |
| 51 |
| 52 // Returns true if the machine is selected for participation in |current_study|. |
| 53 // Dice are rolled on the first invocation to determine in which study the |
| 54 // machine participates. |
| 55 bool IsSelectedForStudy(ExperimentStorage::Lock* lock, |
| 56 ExperimentStorage::Study current_study); |
| 57 |
| 58 // Returns a group number based on the study in which the client participates. |
| 59 int PickGroup(ExperimentStorage::Study participation); |
| 60 |
| 61 // Launches Chrome to present the prompt. |
| 62 void LaunchChrome(const InstallerState& installer_state, |
| 63 const Experiment& experiment); |
| 64 |
| 65 } // namespace installer |
| 66 |
| 67 #endif // CHROME_INSTALLER_SETUP_USER_EXPERIMENT_H_ |
OLD | NEW |