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

Unified Diff: chrome/browser/about_flags.cc

Issue 12276012: Add reset all button to flags page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index f0ade212558075a897dd75445079875d2d3e9953..90c607ad552f5741212c7df294a146b0fbed67c8 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1293,6 +1293,7 @@ class FlagsState {
PrefService* prefs, const std::string& internal_name, bool enable);
void RemoveFlagsSwitches(
std::map<std::string, CommandLine::StringType>* switch_list);
+ void RemoveAllFlags(PrefService* prefs);
void reset();
// Returns the singleton instance of this class
@@ -1514,6 +1515,10 @@ void RemoveFlagsSwitches(
FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
}
+void ResetAllExperiments(PrefService* prefs) {
James Hawkins 2013/02/19 20:49:54 Why is this called ResetAllExperiments but the int
jryans 2013/02/19 21:28:28 Generally there seems be a mixture of "experiment"
James Hawkins 2013/02/19 21:38:43 I'd go with Flags for both.
+ FlagsState::GetInstance()->RemoveAllFlags(prefs);
+}
+
int GetCurrentPlatform() {
#if defined(OS_MACOSX)
return kOsMac;
@@ -1679,6 +1684,13 @@ void FlagsState::RemoveFlagsSwitches(
}
}
+void FlagsState::RemoveAllFlags(PrefService* prefs) {
+ needs_restart_ = true;
+
+ std::set<std::string> no_experiments;
+ SetEnabledFlags(prefs, no_experiments);
+}
+
void FlagsState::reset() {
needs_restart_ = false;
flags_switches_.clear();

Powered by Google App Engine
This is Rietveld 408576698