OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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 // This files declares a class that contains methods and data to conduct |
| 6 // for user expeirments. |
| 7 |
| 8 #ifndef CHROME_INSTALLER_UTIL_USER_EXPERIMENT_H_ |
| 9 #define CHROME_INSTALLER_UTIL_USER_EXPERIMENT_H_ |
| 10 |
| 11 #include "base/string16.h" |
| 12 #include "chrome/installer/util/util_constants.h" |
| 13 |
| 14 class BrowserDistribution; |
| 15 class CommandLine; |
| 16 |
| 17 namespace base { |
| 18 class FilePath; |
| 19 } |
| 20 |
| 21 namespace installer { |
| 22 |
| 23 class Product; |
| 24 |
| 25 // Flags to control what to show in the UserExperiment dialog. |
| 26 enum ToastUiFlags { |
| 27 kToastUiUninstall = 1 << 0, // Uninstall radio button. |
| 28 kToastUiDontBugMeAsButton = 1 << 1, // This is a button, not a radio button. |
| 29 kToastUiWhyLink = 1 << 2, // Has the 'why I am seeing this' link. |
| 30 kToastUiMakeDefault = 1 << 3, // Has the 'make it default' checkbox. |
| 31 }; |
| 32 |
| 33 // A struct for communicating what a UserExperiment contains. In these |
| 34 // experiments we show toasts to the user if they are inactive for a certain |
| 35 // amount of time. |
| 36 struct ExperimentDetails { |
| 37 string16 prefix; // The experiment code prefix for this experiment, |
| 38 // also known as the 'TV' part in 'TV80'. |
| 39 int flavor; // The flavor index for this experiment. |
| 40 int heading; // The heading resource ID to use for this experiment. |
| 41 int flags; // See ToastUIFlags above. |
| 42 int control_group; // Size of the control group (in percentages). Control |
| 43 // group is the group that qualifies for the |
| 44 // experiment but does not participate. |
| 45 }; |
| 46 |
| 47 // Creates the experiment details for a given language-brand combo. |
| 48 // If |flavor| is -1, then a flavor will be selected at random. |experiment| |
| 49 // is the struct you want to write the experiment information to. |
| 50 // Returns false if no experiment details could be gathered. |
| 51 bool CreateExperimentDetails(int flavor, ExperimentDetails* experiment); |
| 52 |
| 53 // After an install or upgrade the user might qualify to participate in an |
| 54 // experiment. This function determines if the user qualifies and if so it |
| 55 // sets the wheels in motion or in simple cases does the experiment itself. |
| 56 void LaunchBrowserUserExperiment(const CommandLine& base_command, |
| 57 InstallStatus status, |
| 58 bool system_level); |
| 59 |
| 60 // The user has qualified for the inactive user toast experiment and this |
| 61 // function just performs it. |
| 62 void InactiveUserToastExperiment(BrowserDistribution* dist, |
| 63 int flavor, |
| 64 const string16& experiment_group, |
| 65 const Product& installation, |
| 66 const base::FilePath& application_path); |
| 67 |
| 68 } // namespace installer |
| 69 |
| 70 #endif // CHROME_INSTALLER_UTIL_USER_EXPERIMENT_H_ |
OLD | NEW |