sdefresne | 0e56634 | 2015-11-24 08:55:46 | [diff] [blame] | 1 | // Copyright 2015 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 COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ |
| 6 | #define COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ |
| 7 | |
avi | bc5337b | 2015-12-25 23:16:33 | [diff] [blame] | 8 | #include <stddef.h> |
| 9 | |
sdefresne | 0e56634 | 2015-11-24 08:55:46 | [diff] [blame] | 10 | #include <map> |
| 11 | #include <set> |
| 12 | #include <string> |
jkrcal | bf07337 | 2016-07-29 07:21:31 | [diff] [blame] | 13 | #include <vector> |
sdefresne | 0e56634 | 2015-11-24 08:55:46 | [diff] [blame] | 14 | |
Elly Fong-Jones | c3e9aea | 2019-10-24 19:44:19 | [diff] [blame] | 15 | #include "base/callback.h" |
sdefresne | 0e56634 | 2015-11-24 08:55:46 | [diff] [blame] | 16 | #include "base/command_line.h" |
Elly Fong-Jones | 3cd7528 | 2019-11-12 20:26:50 | [diff] [blame] | 17 | #include "base/containers/span.h" |
Elly Fong-Jones | d488661c | 2019-07-31 21:53:26 | [diff] [blame] | 18 | #include "base/feature_list.h" |
sdefresne | 0e56634 | 2015-11-24 08:55:46 | [diff] [blame] | 19 | #include "base/macros.h" |
Morten Stenshorne | 7afa580 | 2021-07-15 10:04:43 | [diff] [blame] | 20 | #include "base/values.h" |
sdefresne | 0e56634 | 2015-11-24 08:55:46 | [diff] [blame] | 21 | |
| 22 | namespace flags_ui { |
| 23 | |
jkrcal | 1383d1d | 2016-06-17 12:40:56 | [diff] [blame] | 24 | // Internal functionality exposed for tests. |
| 25 | namespace internal { |
| 26 | // The trial group selected when feature variation parameters are registered via |
| 27 | // FlagsState::RegisterFeatureVariationParameters(). |
| 28 | extern const char kTrialGroupAboutFlags[]; |
| 29 | } // namespace internal |
| 30 | |
sdefresne | 0e56634 | 2015-11-24 08:55:46 | [diff] [blame] | 31 | struct FeatureEntry; |
| 32 | class FlagsStorage; |
| 33 | struct SwitchEntry; |
| 34 | |
Michael Bai | fee012d | 2021-08-11 17:13:24 | [diff] [blame] | 35 | // Enumeration of flag filters. These values don't persist and can be |
| 36 | // renumbered. |
sdefresne | 0e56634 | 2015-11-24 08:55:46 | [diff] [blame] | 37 | enum { |
| 38 | kOsMac = 1 << 0, |
| 39 | kOsWin = 1 << 1, |
| 40 | kOsLinux = 1 << 2, |
| 41 | kOsCrOS = 1 << 3, |
| 42 | kOsAndroid = 1 << 4, |
sdefresne | abf86006 | 2015-11-26 09:45:22 | [diff] [blame] | 43 | kOsCrOSOwnerOnly = 1 << 5, |
| 44 | kOsIos = 1 << 6, |
Michael Bai | fee012d | 2021-08-11 17:13:24 | [diff] [blame] | 45 | kOsFuchsia = 1 << 7, |
| 46 | kOsWebView = 1 << 8, |
| 47 | |
| 48 | kDeprecated = 1 << 9, |
Elly Fong-Jones | 4054f14 | 2020-04-17 17:12:33 | [diff] [blame] | 49 | |
| 50 | // Flags marked with this are internal to the flags system. Never set this on |
| 51 | // a manually-added flag. |
Michael Bai | fee012d | 2021-08-11 17:13:24 | [diff] [blame] | 52 | kFlagInfrastructure = 1 << 10, |
sdefresne | 0e56634 | 2015-11-24 08:55:46 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | // A flag controlling the behavior of the |ConvertFlagsToSwitches| function - |
| 56 | // whether it should add the sentinel switches around flags. |
| 57 | enum SentinelsMode { kNoSentinels, kAddSentinels }; |
| 58 | |
| 59 | // Differentiate between generic flags available on a per session base and flags |
| 60 | // that influence the whole machine and can be said by the admin only. This flag |
| 61 | // is relevant for ChromeOS for now only and dictates whether entries marked |
| 62 | // with the |kOsCrOSOwnerOnly| label should be enabled in the UI or not. |
noyau |
|