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

Unified Diff: apps/app_launcher.cc

Issue 17226003: Add metrics for interactions with the Apps Launcher promo dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed gyp file. :-/ Created 7 years, 6 months 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 | « apps/app_launcher.h ('k') | apps/apps.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_launcher.cc
diff --git a/apps/app_launcher.cc b/apps/app_launcher.cc
index 0493c65aa4d8d30c530520fcd3531c31caf35b19..3f00b47a6cbeb8f36b9c72de1047e19cc5a8721d 100644
--- a/apps/app_launcher.cc
+++ b/apps/app_launcher.cc
@@ -4,7 +4,9 @@
#include "apps/app_launcher.h"
+#include "apps/field_trial_names.h"
#include "apps/pref_names.h"
+#include "base/metrics/field_trial.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/browser_process.h"
@@ -35,4 +37,18 @@ bool IsAppLauncherEnabled() {
#endif
}
+bool ShouldShowAppLauncherPromo() {
+ PrefService* local_state = g_browser_process->local_state();
+ // In some tests, the prefs aren't initialised.
+ if (!local_state)
+ return false;
+ std::string app_launcher_promo_group_name =
+ base::FieldTrialList::FindFullName(apps::kLauncherPromoTrialName);
+ return !IsAppLauncherEnabled() &&
+ local_state->GetBoolean(apps::prefs::kShowAppLauncherPromo) &&
+ (app_launcher_promo_group_name == apps::kShowLauncherPromoOnceGroupName ||
+ app_launcher_promo_group_name ==
+ apps::kResetShowLauncherPromoPrefGroupName);
+}
+
} // namespace apps
« no previous file with comments | « apps/app_launcher.h ('k') | apps/apps.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698