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