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

Unified Diff: chrome/browser/ui/webui/sync_promo/sync_promo_ui.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
index 9f92d22301b8bbd887b3aecb83575d2de15e3d0d..193465ec1ef79d19d62d38086ef4a55d1b563cac 100644
--- a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
+++ b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
@@ -123,8 +123,15 @@ SyncPromoUI::SyncPromoUI(TabContents* contents) : ChromeWebUI(contents) {
html_source->set_default_resource(IDR_SYNC_PROMO_HTML);
profile->GetChromeURLDataManager()->AddDataSource(html_source);
- if (sync_promo_trial::IsPartOfBrandTrialToEnable())
- sync_promo_trial::RecordUserShownPromoWithTrialBrand();
+ if (sync_promo_trial::IsPartOfBrandTrialToEnable()) {
+ bool is_start_up = GetIsLaunchPageForSyncPromoURL(contents->GetURL());
+ sync_promo_trial::RecordUserShownPromoWithTrialBrand(is_start_up, profile);
+ }
+}
+
+// static
+bool SyncPromoUI::HasShownPromoAtStartup(Profile* profile) {
+ return profile->GetPrefs()->HasPrefPath(prefs::kSyncPromoStartupCount);
}
// static
@@ -161,8 +168,10 @@ void SyncPromoUI::RegisterUserPrefs(PrefService* prefs) {
SyncPromoHandler::RegisterUserPrefs(prefs);
}
+// static
bool SyncPromoUI::ShouldShowSyncPromoAtStartup(Profile* profile,
bool is_new_profile) {
+ DCHECK(profile);
if (!ShouldShowSyncPromo(profile))
return false;
@@ -170,9 +179,8 @@ bool SyncPromoUI::ShouldShowSyncPromoAtStartup(Profile* profile,
if (command_line.HasSwitch(switches::kNoFirstRun))
is_new_profile = false;
- PrefService *prefs = profile->GetPrefs();
if (!is_new_profile) {
- if (!prefs->HasPrefPath(prefs::kSyncPromoStartupCount))
+ if (!HasShownPromoAtStartup(profile))
return false;
}
@@ -183,6 +191,7 @@ bool SyncPromoUI::ShouldShowSyncPromoAtStartup(Profile* profile,
if (g_browser_process->GetApplicationLocale() == "zh-CN")
return false;
+ PrefService *prefs = profile->GetPrefs();
int show_count = prefs->GetInteger(prefs::kSyncPromoStartupCount);
if (show_count >= kSyncPromoShowAtStartupMaximum)
return false;
« no previous file with comments | « chrome/browser/ui/webui/sync_promo/sync_promo_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698