OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_TRIAL_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_TRIAL_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 |
| 10 class Profile; |
| 11 |
| 12 // These helpers manage the Sync Promo field trial. |
| 13 // |
| 14 // The sync promo experiment involves changing the message body in the sign in |
| 15 // promo (see SyncPromoHandler) to see if that has any effect on sign in. |
| 16 namespace sync_promo_trial { |
| 17 enum Group { |
| 18 // "Get your bookmarks, history, and settings on all your devices." |
| 19 // This is also the default message group. |
| 20 PROMO_MSG_A = 0, |
| 21 |
| 22 // "Back up your bookmarks, history, and settings to the web." |
| 23 PROMO_MSG_B, |
| 24 |
| 25 // "Sync your personalized browser features between all your devices." |
| 26 PROMO_MSG_C, |
| 27 |
| 28 // "You'll be automatically signed into to your favorite Google services." |
| 29 PROMO_MSG_D, |
| 30 |
| 31 // Bounding max value needed for UMA histogram macro. |
| 32 PROMO_MSG_MAX, |
| 33 }; |
| 34 |
| 35 enum SyncPromoEnabledBrandUMABuckets { |
| 36 WITH_SYNC_PROMO_WITH_DEFAULT_APPS = 0, |
| 37 WITH_SYNC_PROMO_WITHOUT_DEFAULT_APPS, |
| 38 WITHOUT_SYNC_PROMO_WITHOUT_DEFAULT_APPS_A, |
| 39 WITHOUT_SYNC_PROMO_WITHOUT_DEFAULT_APPS_B, |
| 40 SYNC_PROMO_AND_DEFAULT_APPS_BOUNDARY, |
| 41 }; |
| 42 |
| 43 // Activate the field trial. Before this call, all calls to GetGroup will |
| 44 // return PROMO_MSG_A. *** MUST NOT BE CALLED MORE THAN ONCE. *** |
| 45 void Activate(); |
| 46 |
| 47 // Returns true iff the experiment has been set up and is active. If this |
| 48 // is false, the caller should not record stats for this experiment. |
| 49 bool IsExperimentActive(); |
| 50 |
| 51 // If the user has been tagged with a brand code at install time that |
| 52 // determines if they should see the sync promo or not. |
| 53 bool IsPartOfBrandTrialToEnable(); |
| 54 |
| 55 // Return the field trial group this client belongs to. |
| 56 Group GetGroup(); |
| 57 |
| 58 // Return the UMA bucket |
| 59 int GetSyncPromoBrandUMABucketFromGroup(); |
| 60 |
| 61 // Return the resource ID for the Sync Promo message body associated with this |
| 62 // client. |
| 63 int GetMessageBodyResID(); |
| 64 |
| 65 // Record the appropriate UMA stat for when a user sees the sync promo |
| 66 // message. |
| 67 void RecordUserSawMessage(); |
| 68 |
| 69 // Record that a user was shown the promo when tagged with an experimental |
| 70 // brand code. |
| 71 void RecordUserShownPromoWithTrialBrand(bool is_at_startup, Profile* profile); |
| 72 |
| 73 // Record the appropriate UMA stat for when a user successfully signs in to |
| 74 // GAIA. |
| 75 void RecordUserSignedIn(); |
| 76 |
| 77 // Record that a user signed in while tagged with a brand code currently being |
| 78 // used in a field trial. |
| 79 void RecordUserSignedInWithTrialBrand(bool is_at_startup, Profile* profile); |
| 80 |
| 81 // If we've been tagged with any of the experimental brands to show the sync |
| 82 // promo. |
| 83 bool ShouldShowAtStartupBasedOnBrand(); |
| 84 } |
| 85 |
| 86 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_TRIAL_H_ |
OLD | NEW |