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