diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-09 20:39:01 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-09 20:39:01 +0000 |
commit | cece7398dc13823684e6271ad3ac58795a5f1c73 (patch) | |
tree | f96c3edc44de8093df4e515c3628f3dd2270030c | |
parent | c84a75f36d228506d74e434f51acd33038730d98 (diff) | |
download | chromium_src-cece7398dc13823684e6271ad3ac58795a5f1c73.zip chromium_src-cece7398dc13823684e6271ad3ac58795a5f1c73.tar.gz chromium_src-cece7398dc13823684e6271ad3ac58795a5f1c73.tar.bz2 |
Merge 121153 - Ensure that we record sync promo suppressions
Currently we record which version of the sync promo a user was shown from the SyncPromoUI constructor.
This lead to a problem where we didn't count the "don't show sync promo" trial. To fix this we explicitly record the "don't show" trial in BrowserInit.
BUG=113135
TEST=
Review URL: http://codereview.chromium.org/9358017
TBR=sail@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9371023
git-svn-id: svn://svn.chromium.org/chrome/branches/1025/src@121280 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/browser_init.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc | 10 | ||||
-rw-r--r-- | chrome/browser/ui/webui/sync_promo/sync_promo_trial.h | 4 |
3 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index acc970b..ae2f8de 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -70,6 +70,7 @@ #include "chrome/browser/ui/dialog_style.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/webui/sync_promo/sync_promo_dialog.h" +#include "chrome/browser/ui/webui/sync_promo/sync_promo_trial.h" #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_notification_types.h" @@ -1458,6 +1459,9 @@ void BrowserInit::LaunchWithProfile::AddStartupURLs( if (it != startup_urls->end()) startup_urls->erase(it); } + } else if (sync_promo_trial::GetStartupOverrideForCurrentTrial() == + sync_promo_trial::STARTUP_OVERRIDE_HIDE) { + sync_promo_trial::RecordSyncPromoSuppressedForCurrentTrial(); } } diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc index ad8fd3f..9e846d1 100644 --- a/chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc +++ b/chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc @@ -129,6 +129,16 @@ void RecordUserShownPromo(content::WebUI* web_ui) { } } +void RecordSyncPromoSuppressedForCurrentTrial() { + DCHECK(sync_promo_trial_initialized); + LayoutExperimentType type = LAYOUT_EXPERIMENT_DEFAULT; + DCHECK(GetActiveLayoutExperiment(&type) && type == LAYOUT_EXPERIMENT_NONE); + // Avoid warning about unused variable in release builds. + (void)type; + UMA_HISTOGRAM_ENUMERATION("SyncPromo.ShownPromoWithLayoutExpAtStartup", + LAYOUT_EXPERIMENT_NONE, LAYOUT_EXPERIMENT_BOUNDARY); +} + void RecordUserSignedIn(content::WebUI* web_ui) { DCHECK(sync_promo_trial_initialized); diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_trial.h b/chrome/browser/ui/webui/sync_promo/sync_promo_trial.h index 1a002f7..4378668 100644 --- a/chrome/browser/ui/webui/sync_promo/sync_promo_trial.h +++ b/chrome/browser/ui/webui/sync_promo/sync_promo_trial.h @@ -32,6 +32,10 @@ StartupOverride GetStartupOverrideForCurrentTrial(); // promo trials. |web_ui| is the web UI where the promo was shown. void RecordUserShownPromo(content::WebUI* web_ui); +// Records that the sync promo was not shown to the user (when it normally +// would have been shown) because of the current trial. +void RecordSyncPromoSuppressedForCurrentTrial(); + // Records that the user signed into sync for any currently running sync promo // trials. |web_ui| is the web UI where the user signed into sync. void RecordUserSignedIn(content::WebUI* web_ui); |