OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ | 5 #ifndef COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ |
6 #define COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ | 6 #define COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 // Enumeration of OSs. | 37 // Enumeration of OSs. |
38 enum { | 38 enum { |
39 kOsMac = 1 << 0, | 39 kOsMac = 1 << 0, |
40 kOsWin = 1 << 1, | 40 kOsWin = 1 << 1, |
41 kOsLinux = 1 << 2, | 41 kOsLinux = 1 << 2, |
42 kOsCrOS = 1 << 3, | 42 kOsCrOS = 1 << 3, |
43 kOsAndroid = 1 << 4, | 43 kOsAndroid = 1 << 4, |
44 kOsCrOSOwnerOnly = 1 << 5, | 44 kOsCrOSOwnerOnly = 1 << 5, |
45 kOsIos = 1 << 6, | 45 kOsIos = 1 << 6, |
46 kOsIosAppleReview = 1 << 7, | |
47 }; | 46 }; |
48 | 47 |
49 // A flag controlling the behavior of the |ConvertFlagsToSwitches| function - | 48 // A flag controlling the behavior of the |ConvertFlagsToSwitches| function - |
50 // whether it should add the sentinel switches around flags. | 49 // whether it should add the sentinel switches around flags. |
51 enum SentinelsMode { kNoSentinels, kAddSentinels }; | 50 enum SentinelsMode { kNoSentinels, kAddSentinels }; |
52 | 51 |
53 // Differentiate between generic flags available on a per session base and flags | 52 // Differentiate between generic flags available on a per session base and flags |
54 // that influence the whole machine and can be said by the admin only. This flag | 53 // that influence the whole machine and can be said by the admin only. This flag |
55 // is relevant for ChromeOS for now only and dictates whether entries marked | 54 // is relevant for ChromeOS for now only and dictates whether entries marked |
56 // with the |kOsCrOSOwnerOnly| label should be enabled in the UI or not. | 55 // with the |kOsCrOSOwnerOnly| label should be enabled in the UI or not. |
57 // On iOS, |kAppleReviewAccessToFlags| indicates that the flags shown should | 56 enum FlagAccess { kGeneralAccessFlagsOnly, kOwnerAccessToFlags }; |
58 // be the ones marked for Apple review (which otherwise will not be shown). | |
59 enum FlagAccess { kGeneralAccessFlagsOnly, kOwnerAccessToFlags, | |
60 kAppleReviewAccessToFlags }; | |
61 | 57 |
62 // Stores and encapsulates the little state that about:flags has. | 58 // Stores and encapsulates the little state that about:flags has. |
63 class FlagsState { | 59 class FlagsState { |
64 public: | 60 public: |
65 FlagsState(const FeatureEntry* feature_entries, size_t num_feature_entries); | 61 FlagsState(const FeatureEntry* feature_entries, size_t num_feature_entries); |
66 ~FlagsState(); | 62 ~FlagsState(); |
67 | 63 |
68 // Reads the state from |flags_storage| and adds the command line flags | 64 // Reads the state from |flags_storage| and adds the command line flags |
69 // belonging to the active feature entries to |command_line|. Features are | 65 // belonging to the active feature entries to |command_line|. Features are |
70 // appended via |enable_features_flag_name| and |disable_features_flag_name|. | 66 // appended via |enable_features_flag_name| and |disable_features_flag_name|. |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // Map from switch name to a set of string, that keeps track which strings | 200 // Map from switch name to a set of string, that keeps track which strings |
205 // were appended to existing (list value) switches. | 201 // were appended to existing (list value) switches. |
206 std::map<std::string, std::set<std::string>> appended_switches_; | 202 std::map<std::string, std::set<std::string>> appended_switches_; |
207 | 203 |
208 DISALLOW_COPY_AND_ASSIGN(FlagsState); | 204 DISALLOW_COPY_AND_ASSIGN(FlagsState); |
209 }; | 205 }; |
210 | 206 |
211 } // namespace flags_ui | 207 } // namespace flags_ui |
212 | 208 |
213 #endif // COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ | 209 #endif // COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ |
OLD | NEW |