Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc

Issue 9007041: [Sync Promo UI] Change data reporting to differentiate between startup and other (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/sync_promo/sync_promo_trial.h" 5 #include "chrome/browser/ui/webui/sync_promo/sync_promo_trial.h"
6 6
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "chrome/browser/google/google_util.h" 9 #include "chrome/browser/google/google_util.h"
10 #include "chrome/browser/metrics/metrics_service.h" 10 #include "chrome/browser/metrics/metrics_service.h"
11 #include "chrome/browser/prefs/pref_service.h" 11 #include "chrome/browser/prefs/pref_service.h"
12 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
12 #include "grit/generated_resources.h" 13 #include "grit/generated_resources.h"
13 14
14 namespace sync_promo_trial { 15 namespace sync_promo_trial {
15 16
16 // Field trial IDs of the control and experiment groups. Though they are not 17 // Field trial IDs of the control and experiment groups. Though they are not
17 // literally "const", they are set only once, in Activate() below. See the .h 18 // literally "const", they are set only once, in Activate() below. See the .h
18 // file for what these groups represent. 19 // file for what these groups represent.
19 int g_sync_promo_experiment_a = 0; 20 int g_sync_promo_experiment_a = 0;
20 int g_sync_promo_experiment_b = 0; 21 int g_sync_promo_experiment_b = 0;
21 int g_sync_promo_experiment_c = 0; 22 int g_sync_promo_experiment_c = 0;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 return IDS_SYNC_PROMO_MESSAGE_BODY_A; 134 return IDS_SYNC_PROMO_MESSAGE_BODY_A;
134 } 135 }
135 136
136 void RecordUserSawMessage() { 137 void RecordUserSawMessage() {
137 DCHECK(IsExperimentActive()); 138 DCHECK(IsExperimentActive());
138 UMA_HISTOGRAM_ENUMERATION("SyncPromo.MessageDisplayed", 139 UMA_HISTOGRAM_ENUMERATION("SyncPromo.MessageDisplayed",
139 GetGroup(), 140 GetGroup(),
140 PROMO_MSG_MAX); 141 PROMO_MSG_MAX);
141 } 142 }
142 143
143 void RecordUserShownPromoWithTrialBrand() { 144 void RecordUserShownPromoWithTrialBrand(bool is_at_startup, Profile* profile) {
144 DCHECK(IsPartOfBrandTrialToEnable()); 145 DCHECK(IsPartOfBrandTrialToEnable());
145 UMA_HISTOGRAM_ENUMERATION("SyncPromo.ShownPromoWithBrand", 146 if (is_at_startup) {
146 GetSyncPromoBrandUMABucketFromGroup(), 147 DCHECK(SyncPromoUI::HasShownPromoAtStartup(profile));
147 SYNC_PROMO_AND_DEFAULT_APPS_BOUNDARY); 148 UMA_HISTOGRAM_ENUMERATION("SyncPromo.ShownPromoWithBrandAtStartup",
149 GetSyncPromoBrandUMABucketFromGroup(),
150 SYNC_PROMO_AND_DEFAULT_APPS_BOUNDARY);
151 } else {
152 UMA_HISTOGRAM_ENUMERATION("SyncPromo.ShownPromoWithBrand",
153 GetSyncPromoBrandUMABucketFromGroup(),
154 SYNC_PROMO_AND_DEFAULT_APPS_BOUNDARY);
155 }
148 } 156 }
149 157
150 void RecordUserSignedIn() { 158 void RecordUserSignedIn() {
151 DCHECK(IsExperimentActive()); 159 DCHECK(IsExperimentActive());
152 UMA_HISTOGRAM_ENUMERATION("SyncPromo.MessageOnSignIn", 160 UMA_HISTOGRAM_ENUMERATION("SyncPromo.MessageOnSignIn",
153 GetGroup(), 161 GetGroup(),
154 PROMO_MSG_MAX); 162 PROMO_MSG_MAX);
155 } 163 }
156 164
157 void RecordUserSignedInWithTrialBrand() { 165 void RecordUserSignedInWithTrialBrand(bool is_at_startup, Profile* profile) {
158 DCHECK(IsPartOfBrandTrialToEnable()); 166 DCHECK(IsPartOfBrandTrialToEnable());
159 UMA_HISTOGRAM_ENUMERATION("SyncPromo.SignedInWithBrand", 167 if (is_at_startup) {
160 GetSyncPromoBrandUMABucketFromGroup(), 168 DCHECK(SyncPromoUI::HasShownPromoAtStartup(profile));
161 SYNC_PROMO_AND_DEFAULT_APPS_BOUNDARY); 169 UMA_HISTOGRAM_ENUMERATION("SyncPromo.SignedInWithBrandAtStartup",
170 GetSyncPromoBrandUMABucketFromGroup(),
171 SYNC_PROMO_AND_DEFAULT_APPS_BOUNDARY);
172 } else {
173 UMA_HISTOGRAM_ENUMERATION("SyncPromo.SignedInWithBrand",
174 GetSyncPromoBrandUMABucketFromGroup(),
175 SYNC_PROMO_AND_DEFAULT_APPS_BOUNDARY);
176 }
162 } 177 }
163 178
164 bool ShouldShowAtStartupBasedOnBrand() { 179 bool ShouldShowAtStartupBasedOnBrand() {
165 DCHECK(IsPartOfBrandTrialToEnable()); 180 DCHECK(IsPartOfBrandTrialToEnable());
166 std::string name = 181 std::string name =
167 base::FieldTrialList::Find(kSyncPromoEnabledTrialName)->group_name(); 182 base::FieldTrialList::Find(kSyncPromoEnabledTrialName)->group_name();
168 return name == kSyncPromoEnabledWithApps || 183 return name == kSyncPromoEnabledWithApps ||
169 name == kSyncPromoEnabledWithoutApps; 184 name == kSyncPromoEnabledWithoutApps;
170 } 185 }
171 186
172 } // namespace sync_promo_trial 187 } // namespace sync_promo_trial
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_trial.h ('k') | chrome/browser/ui/webui/sync_promo/sync_promo_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698