summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/apps.gypi2
-rw-r--r--apps/field_trial_names.cc19
-rw-r--r--apps/field_trial_names.h18
-rw-r--r--apps/pref_names.cc3
-rw-r--r--apps/pref_names.h1
-rw-r--r--apps/prefs.cc6
6 files changed, 48 insertions, 1 deletions
diff --git a/apps/apps.gypi b/apps/apps.gypi
index 8760e17..61f42e9 100644
--- a/apps/apps.gypi
+++ b/apps/apps.gypi
@@ -34,6 +34,8 @@
'app_shim/app_shim_host_mac.h',
'app_shim/app_shim_host_manager_mac.h',
'app_shim/app_shim_host_manager_mac.mm',
+ 'field_trial_names.cc',
+ 'field_trial_names.h',
'pref_names.cc',
'pref_names.h',
'prefs.cc',
diff --git a/apps/field_trial_names.cc b/apps/field_trial_names.cc
new file mode 100644
index 0000000..9e5cbcf
--- /dev/null
+++ b/apps/field_trial_names.cc
@@ -0,0 +1,19 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "apps/field_trial_names.h"
+
+namespace apps {
+
+// The field trial group name that enables showing the promo.
+const char kShowLauncherPromoOnceGroupName[] = "ShowPromoUntilDismissed";
+
+// The field trial group name that resets the pref to show the app launcher
+// promo on every session startup.
+const char kResetShowLauncherPromoPrefGroupName[] = "ResetShowPromoPref";
+
+// The name of the field trial that controls showing the app launcher promo.
+const char kLauncherPromoTrialName[] = "ShowAppLauncherPromo";
+
+} // namespace apps
diff --git a/apps/field_trial_names.h b/apps/field_trial_names.h
new file mode 100644
index 0000000..568ae43d
--- /dev/null
+++ b/apps/field_trial_names.h
@@ -0,0 +1,18 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef APPS_FIELD_TRIAL_NAMES_H_
+#define APPS_FIELD_TRIAL_NAMES_H_
+
+namespace apps {
+
+// Alphabetical list of field trial names specific to Apps component.
+// Keep alphabetized and document each one in the source file.
+extern const char kShowLauncherPromoOnceGroupName[];
+extern const char kResetShowLauncherPromoPrefGroupName[];
+extern const char kLauncherPromoTrialName[];
+
+} // namespace apps
+
+#endif // APPS_FIELD_TRIAL_NAMES_H_
diff --git a/apps/pref_names.cc b/apps/pref_names.cc
index d4ac6fa..cb1cf93 100644
--- a/apps/pref_names.cc
+++ b/apps/pref_names.cc
@@ -21,6 +21,9 @@ const char kAppLaunchForMetroRestart[] = "apps.app_launch_for_metro_restart";
const char kAppLaunchForMetroRestartProfile[] =
"apps.app_launch_for_metro_restart_profile";
+// A boolean identifying if we should show the app launcher promo or not.
+const char kShowAppLauncherPromo[] = "app_launcher.show_promo";
+
} // namespace prefs
} // namespace apps
diff --git a/apps/pref_names.h b/apps/pref_names.h
index db6ad7c..db5d7c2 100644
--- a/apps/pref_names.h
+++ b/apps/pref_names.h
@@ -13,6 +13,7 @@ namespace prefs {
extern const char kAppLauncherIsEnabled[];
extern const char kAppLaunchForMetroRestart[];
extern const char kAppLaunchForMetroRestartProfile[];
+extern const char kShowAppLauncherPromo[];
} // namespace prefs
} // namespace apps
diff --git a/apps/prefs.cc b/apps/prefs.cc
index edaf119..2685860 100644
--- a/apps/prefs.cc
+++ b/apps/prefs.cc
@@ -20,11 +20,15 @@ void RegisterPrefs(PrefRegistrySimple* registry) {
// GetIsAppLauncherEnabled().
registry->RegisterBooleanPref(prefs::kAppLauncherIsEnabled,
MaybeIsAppLauncherEnabled());
-
#if defined(OS_WIN)
registry->RegisterStringPref(prefs::kAppLaunchForMetroRestart, "");
registry->RegisterStringPref(prefs::kAppLaunchForMetroRestartProfile, "");
#endif
+
+ // Identifies whether we should show the app launcher promo or not.
+ // Now that a field trial also controls the showing, so the promo won't show
+ // unless the pref is set AND the field trial is set to a proper group.
+ registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true);
}
} // namespace apps