blob: accb85c70dd92d92e85c29b35ab5b128559c9e84 [file] [log] [blame]
sdefresne246c5642015-11-16 21:47:291// 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_FEATURE_ENTRY_MACROS_H_
6#define COMPONENTS_FLAGS_UI_FEATURE_ENTRY_MACROS_H_
7
avibc5337b2015-12-25 23:16:338
sdefresne246c5642015-11-16 21:47:299// Macros to simplify specifying the type of FeatureEntry. Please refer to
10// the comments on FeatureEntry::Type in feature_entry.h, which explain the
11// different entry types and when they should be used.
Jeremy Roman39086972020-06-15 17:55:4312#define SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
13 flags_ui::FeatureEntry::SINGLE_VALUE, { \
14 .switches = { command_line_switch, switch_value, nullptr, nullptr } \
15 }
sdefresne246c5642015-11-16 21:47:2916#define SINGLE_VALUE_TYPE(command_line_switch) \
17 SINGLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
Jeremy Roman39086972020-06-15 17:55:4318#define ORIGIN_LIST_VALUE_TYPE(command_line_switch, switch_value) \
19 flags_ui::FeatureEntry::ORIGIN_LIST_VALUE, { \
20 .switches = { command_line_switch, switch_value, nullptr, nullptr } \
21 }
sdefresne246c5642015-11-16 21:47:2922#define SINGLE_DISABLE_VALUE_TYPE_AND_VALUE(command_line_switch, switch_value) \
Jeremy Roman39086972020-06-15 17:55:4323 flags_ui::FeatureEntry::SINGLE_DISABLE_VALUE, { \
24 .switches = { command_line_switch, switch_value, nullptr, nullptr } \
25 }
sdefresne246c5642015-11-16 21:47:2926#define SINGLE_DISABLE_VALUE_TYPE(command_line_switch) \
27 SINGLE_DISABLE_VALUE_TYPE_AND_VALUE(command_line_switch, "")
Jeremy Roman39086972020-06-15 17:55:4328#define ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, enable_value, \
29 disable_switch, disable_value) \
30 flags_ui::FeatureEntry::ENABLE_DISABLE_VALUE, { \
31 .switches = { enable_switch, enable_value, disable_switch, disable_value } \
32 }
sdefresne246c5642015-11-16 21:47:2933#define ENABLE_DISABLE_VALUE_TYPE(enable_switch, disable_switch) \
34 ENABLE_DISABLE_VALUE_TYPE_AND_VALUE(enable_switch, "", disable_switch, "")
Jeremy Roman39086972020-06-15 17:55:4335#define MULTI_VALUE_TYPE(choices_list) \
36 flags_ui::FeatureEntry::MULTI_VALUE, { .choices = choices_list }
37#define FEATURE_VALUE_TYPE(feature_entry) \
38 flags_ui::FeatureEntry::FEATURE_VALUE, { \
39 .feature = { &feature_entry, {}, nullptr } \
40 }
41#define FEATURE_WITH_PARAMS_VALUE_TYPE(feature_entry, feature_variations, \
42 feature_trial) \
43 flags_ui::FeatureEntry::FEATURE_WITH_PARAMS_VALUE, { \
44 .feature = { &feature_entry, feature_variations, feature_trial } \
45 }
sdefresne246c5642015-11-16 21:47:2946
47#endif // COMPONENTS_FLAGS_UI_FEATURE_ENTRY_MACROS_H_