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

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: Use ResetAllFlags throughout 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
« no previous file with comments | « chrome/browser/about_flags.h ('k') | chrome/browser/resources/flags.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/about_flags.cc
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index f0ade212558075a897dd75445079875d2d3e9953..10a739a15fb343b6f6ca42bfba34f4b8dbea2f7b 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 ResetAllFlags(PrefService* prefs);
void reset();
// Returns the singleton instance of this class
@@ -1514,6 +1515,10 @@ void RemoveFlagsSwitches(
FlagsState::GetInstance()->RemoveFlagsSwitches(switch_list);
}
+void ResetAllFlags(PrefService* prefs) {
+ FlagsState::GetInstance()->ResetAllFlags(prefs);
+}
+
int GetCurrentPlatform() {
#if defined(OS_MACOSX)
return kOsMac;
@@ -1679,6 +1684,13 @@ void FlagsState::RemoveFlagsSwitches(
}
}
+void FlagsState::ResetAllFlags(PrefService* prefs) {
+ needs_restart_ = true;
+
+ std::set<std::string> no_experiments;
+ SetEnabledFlags(prefs, no_experiments);
+}
+
void FlagsState::reset() {
needs_restart_ = false;
flags_switches_.clear();
« no previous file with comments | « chrome/browser/about_flags.h ('k') | chrome/browser/resources/flags.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698