OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/app_launcher.h" | 5 #include "apps/app_launcher.h" |
6 | 6 |
| 7 #include "apps/field_trial_names.h" |
7 #include "apps/pref_names.h" | 8 #include "apps/pref_names.h" |
| 9 #include "base/metrics/field_trial.h" |
8 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
9 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/ui/host_desktop.h" | 13 #include "chrome/browser/ui/host_desktop.h" |
12 | 14 |
13 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
14 #include "chrome/installer/launcher_support/chrome_launcher_support.h" | 16 #include "chrome/installer/launcher_support/chrome_launcher_support.h" |
15 #include "chrome/installer/util/browser_distribution.h" | 17 #include "chrome/installer/util/browser_distribution.h" |
16 #endif | 18 #endif |
17 | 19 |
(...skipping 10 matching lines...) Expand all Loading... |
28 return true; | 30 return true; |
29 #endif | 31 #endif |
30 PrefService* prefs = g_browser_process->local_state(); | 32 PrefService* prefs = g_browser_process->local_state(); |
31 // In some tests, the prefs aren't initialised. | 33 // In some tests, the prefs aren't initialised. |
32 if (!prefs) | 34 if (!prefs) |
33 return false; | 35 return false; |
34 return prefs->GetBoolean(prefs::kAppLauncherHasBeenEnabled); | 36 return prefs->GetBoolean(prefs::kAppLauncherHasBeenEnabled); |
35 #endif | 37 #endif |
36 } | 38 } |
37 | 39 |
| 40 bool ShouldShowAppLauncherPromo() { |
| 41 PrefService* local_state = g_browser_process->local_state(); |
| 42 // In some tests, the prefs aren't initialised. |
| 43 if (!local_state) |
| 44 return false; |
| 45 std::string app_launcher_promo_group_name = |
| 46 base::FieldTrialList::FindFullName(apps::kLauncherPromoTrialName); |
| 47 return !IsAppLauncherEnabled() && |
| 48 local_state->GetBoolean(apps::prefs::kShowAppLauncherPromo) && |
| 49 (app_launcher_promo_group_name == apps::kShowLauncherPromoOnceGroupName || |
| 50 app_launcher_promo_group_name == |
| 51 apps::kResetShowLauncherPromoPrefGroupName); |
| 52 } |
| 53 |
38 } // namespace apps | 54 } // namespace apps |
OLD | NEW |