Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Unified Diff: components/flags_ui/flags_state.h

Issue 2298223002: Fix logging of Launch.FlagsAtStartup histogram. (Closed)
Patch Set: Address comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | components/flags_ui/flags_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/flags_ui/flags_state.h
diff --git a/components/flags_ui/flags_state.h b/components/flags_ui/flags_state.h
index 7d7e933e9b087a6c70fa26c36ff15227c54f5e6a..c7e59be415327483de82f9054c9cc35368934b1f 100644
--- a/components/flags_ui/flags_state.h
+++ b/components/flags_ui/flags_state.h
@@ -73,6 +73,12 @@ class FlagsState {
SentinelsMode sentinels,
const char* enable_features_flag_name,
const char* disable_features_flag_name);
+
+ // Reads the state from |flags_storage| and returns the set of command line
+ // flags that correspond to enabled entries. Does not populate any information
+ // about entries that enable/disable base::Feature states.
+ std::set<std::string> GetSwitchesFromFlags(FlagsStorage* flags_storage);
+
bool IsRestartNeededToCommitChanges();
void SetFeatureEntryEnabled(FlagsStorage* flags_storage,
const std::string& internal_name,
@@ -122,6 +128,10 @@ class FlagsState {
const char* extra_flag_sentinel_end_flag_name);
private:
+ // Keeps track of affected switches for each FeatureEntry, based on which
+ // choice is selected for it.
+ struct SwitchEntry;
+
// Adds mapping to |name_to_switch_map| to set the given switch name/value.
void AddSwitchMapping(const std::string& key,
const std::string& switch_name,
@@ -171,6 +181,15 @@ class FlagsState {
FlagsStorage* flags_storage,
std::set<std::string>* result);
+ // Generates a flags to switches mapping based on the set of enabled flags
+ // from |flags_storage|. On output, |enabled_entries| will contain the
+ // internal names of enabled flags and |name_to_switch_map| will contain
+ // information on how they map to command-line flags or features.
+ void GenerateFlagsToSwitchesMapping(
+ FlagsStorage* flags_storage,
+ std::set<std::string>* enabled_entries,
+ std::map<std::string, SwitchEntry>* name_to_switch_map);
+
const FeatureEntry* feature_entries_;
size_t num_feature_entries_;
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | components/flags_ui/flags_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698