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