blob: c1a46cf7781e4f1e4d3fbead330c1cfe67138b36 [file] [log] [blame]
sdefresne0e566342015-11-24 08:55:461// 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
avibc5337b2015-12-25 23:16:338#include <stddef.h>
9
sdefresne0e566342015-11-24 08:55:4610#include <map>
11#include <set>
12#include <string>
jkrcalbf073372016-07-29 07:21:3113#include <vector>
sdefresne0e566342015-11-24 08:55:4614
Elly Fong-Jonesc3e9aea2019-10-24 19:44:1915#include "base/callback.h"
sdefresne0e566342015-11-24 08:55:4616#include "base/command_line.h"
Elly Fong-Jones3cd75282019-11-12 20:26:5017#include "base/containers/span.h"
Elly Fong-Jonesd488661c2019-07-31 21:53:2618#include "base/feature_list.h"
sdefresne0e566342015-11-24 08:55:4619#include "base/macros.h"
Morten Stenshorne7afa5802021-07-15 10:04:4320#include "base/values.h"
sdefresne0e566342015-11-24 08:55:4621
22namespace flags_ui {
23
jkrcal1383d1d2016-06-17 12:40:5624// Internal functionality exposed for tests.
25namespace internal {
26// The trial group selected when feature variation parameters are registered via
27// FlagsState::RegisterFeatureVariationParameters().
28extern const char kTrialGroupAboutFlags[];
29} // namespace internal
30
sdefresne0e566342015-11-24 08:55:4631struct FeatureEntry;
32class FlagsStorage;
33struct SwitchEntry;
34
Michael Baifee012d2021-08-11 17:13:2435// Enumeration of flag filters. These values don't persist and can be
36// renumbered.
sdefresne0e566342015-11-24 08:55:4637enum {
38 kOsMac = 1 << 0,
39 kOsWin = 1 << 1,
40 kOsLinux = 1 << 2,
41 kOsCrOS = 1 << 3,
42 kOsAndroid = 1 << 4,
sdefresneabf860062015-11-26 09:45:2243 kOsCrOSOwnerOnly = 1 << 5,
44 kOsIos = 1 << 6,
Michael Baifee012d2021-08-11 17:13:2445 kOsFuchsia = 1 << 7,
46 kOsWebView = 1 << 8,
47
48 kDeprecated = 1 << 9,
Elly Fong-Jones4054f142020-04-17 17:12:3349
50 // Flags marked with this are internal to the flags system. Never set this on
51 // a manually-added flag.
Michael Baifee012d2021-08-11 17:13:2452 kFlagInfrastructure = 1 << 10,
sdefresne0e566342015-11-24 08:55:4653};
54
55// A flag controlling the behavior of the |ConvertFlagsToSwitches| function -
56// whether it should add the sentinel switches around flags.
57enum 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