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

Side by Side Diff: components/flags_ui/flags_state.h

Issue 2129543002: Registering field trial for a feature overridden in chrome://flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | components/flags_ui/flags_state.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 13
14 #include "base/callback_forward.h" 14 #include "base/callback_forward.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 17
18 namespace base { 18 namespace base {
19 class FeatureList;
19 class ListValue; 20 class ListValue;
20 } 21 }
21 22
22 namespace flags_ui { 23 namespace flags_ui {
23 24
24 // Internal functionality exposed for tests. 25 // Internal functionality exposed for tests.
25 namespace internal { 26 namespace internal {
26 // The trial group selected when feature variation parameters are registered via 27 // The trial group selected when feature variation parameters are registered via
27 // FlagsState::RegisterFeatureVariationParameters(). 28 // FlagsState::RegisterFeatureVariationParameters().
28 extern const char kTrialGroupAboutFlags[]; 29 extern const char kTrialGroupAboutFlags[];
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 const char* disable_features_flag_name); 74 const char* disable_features_flag_name);
74 bool IsRestartNeededToCommitChanges(); 75 bool IsRestartNeededToCommitChanges();
75 void SetFeatureEntryEnabled(FlagsStorage* flags_storage, 76 void SetFeatureEntryEnabled(FlagsStorage* flags_storage,
76 const std::string& internal_name, 77 const std::string& internal_name,
77 bool enable); 78 bool enable);
78 void RemoveFlagsSwitches( 79 void RemoveFlagsSwitches(
79 std::map<std::string, base::CommandLine::StringType>* switch_list); 80 std::map<std::string, base::CommandLine::StringType>* switch_list);
80 void ResetAllFlags(FlagsStorage* flags_storage); 81 void ResetAllFlags(FlagsStorage* flags_storage);
81 void Reset(); 82 void Reset();
82 83
83 // Registers variations parameter values stored in |flags_storage| (previously 84 // Registers variations parameter values selected for features in about:flags.
84 // selected in about:flags). 85 // The selected flags are retrieved from |flags_storage|, the registered
85 void RegisterAllFeatureVariationParameters(FlagsStorage* flags_storage); 86 // variation parameters are connected to their corresponding features in
87 // |feature_list|.
88 void RegisterAllFeatureVariationParameters(FlagsStorage* flags_storage,
89 base::FeatureList* feature_list);
86 90
87 // Gets the list of feature entries. Entries that are available for the 91 // Gets the list of feature entries. Entries that are available for the
88 // current platform are appended to |supported_entries|; all other entries are 92 // current platform are appended to |supported_entries|; all other entries are
89 // appended to |unsupported_entries|. 93 // appended to |unsupported_entries|.
90 void GetFlagFeatureEntries( 94 void GetFlagFeatureEntries(
91 FlagsStorage* flags_storage, 95 FlagsStorage* flags_storage,
92 FlagAccess access, 96 FlagAccess access,
93 base::ListValue* supported_entries, 97 base::ListValue* supported_entries,
94 base::ListValue* unsupported_entries, 98 base::ListValue* unsupported_entries,
95 base::Callback<bool(const FeatureEntry&)> skip_feature_entry); 99 base::Callback<bool(const FeatureEntry&)> skip_feature_entry);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // Map from switch name to a set of string, that keeps track which strings 176 // Map from switch name to a set of string, that keeps track which strings
173 // were appended to existing (list value) switches. 177 // were appended to existing (list value) switches.
174 std::map<std::string, std::set<std::string>> appended_switches_; 178 std::map<std::string, std::set<std::string>> appended_switches_;
175 179
176 DISALLOW_COPY_AND_ASSIGN(FlagsState); 180 DISALLOW_COPY_AND_ASSIGN(FlagsState);
177 }; 181 };
178 182
179 } // namespace flags_ui 183 } // namespace flags_ui
180 184
181 #endif // COMPONENTS_FLAGS_UI_FLAGS_STATE_H_ 185 #endif // COMPONENTS_FLAGS_UI_FLAGS_STATE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | components/flags_ui/flags_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698