1 // Copyright 2020 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef IOS_CHROME_BROWSER_UI_FIRST_RUN_LOCATION_PERMISSIONS_FIELD_TRIAL_H_
6 #define IOS_CHROME_BROWSER_UI_FIRST_RUN_LOCATION_PERMISSIONS_FIELD_TRIAL_H_
7 
8 #include "base/metrics/field_trial.h"
9 
10 class PrefRegistrySimple;
11 class PrefService;
12 
13 namespace base {
14 class FeatureList;
15 }  // namespace base
16 
17 namespace location_permissions_field_trial {
18 
19 // Returns true if the user is in the group that will be shown the First Run
20 // Modal.
21 bool IsInFirstRunModalGroup();
22 
23 // Returns true if the user is in the group that will have the location prompt
24 // removed from First Run.
25 bool IsInRemoveFirstRunPromptGroup();
26 
27 // Registers the local state pref used to manage grouping for this field trial.
28 void RegisterLocalStatePrefs(PrefRegistrySimple* registry);
29 
30 // Creates a field trial to control the LocationPermissions feature. The trial
31 // is client controlled because one arm of the experiment involves changing the
32 // user experience during First Run.
33 //
34 // The trial group chosen on first run is persisted to local state prefs.
35 void Create(const base::FieldTrial::EntropyProvider& low_entropy_provider,
36             base::FeatureList* feature_list,
37             PrefService* local_state);
38 
39 }  // namespace location_permissions_field_trial
40 
41 #endif  // IOS_CHROME_BROWSER_UI_FIRST_RUN_LOCATION_PERMISSIONS_FIELD_TRIAL_H_
42