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

Unified Diff: chrome/browser/ui/webui/flags_ui.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/resources/flags.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/flags_ui.cc
diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc
index cb7467e58f5d4521355a091bb94a8f73e41aa547..3d898abc743769532de2ab3e138b4b39b0ecfb34 100644
--- a/chrome/browser/ui/webui/flags_ui.cc
+++ b/chrome/browser/ui/webui/flags_ui.cc
@@ -54,6 +54,7 @@ content::WebUIDataSource* CreateFlagsUIHTMLSource() {
source->AddLocalizedString("flagsNotSupported", IDS_FLAGS_NOT_AVAILABLE);
source->AddLocalizedString("flagsRestartNotice", IDS_FLAGS_RELAUNCH_NOTICE);
source->AddLocalizedString("flagsRestartButton", IDS_FLAGS_RELAUNCH_BUTTON);
+ source->AddLocalizedString("resetAllButton", IDS_FLAGS_RESET_ALL_BUTTON);
source->AddLocalizedString("disable", IDS_FLAGS_DISABLE);
source->AddLocalizedString("enable", IDS_FLAGS_ENABLE);
#if defined(OS_CHROMEOS)
@@ -101,6 +102,9 @@ class FlagsDOMHandler : public WebUIMessageHandler {
// Callback for the "restartBrowser" message. Restores all tabs on restart.
void HandleRestartBrowser(const ListValue* args);
+ // Callback for the "resetAllFlags" message.
+ void HandleResetAllFlags(const ListValue* args);
+
private:
DISALLOW_COPY_AND_ASSIGN(FlagsDOMHandler);
};
@@ -115,6 +119,9 @@ void FlagsDOMHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("restartBrowser",
base::Bind(&FlagsDOMHandler::HandleRestartBrowser,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback("resetAllFlags",
+ base::Bind(&FlagsDOMHandler::HandleResetAllFlags,
+ base::Unretained(this)));
}
void FlagsDOMHandler::HandleRequestFlagsExperiments(const ListValue* args) {
@@ -149,6 +156,10 @@ void FlagsDOMHandler::HandleRestartBrowser(const ListValue* args) {
browser::AttemptRestart();
}
+void FlagsDOMHandler::HandleResetAllFlags(const ListValue* args) {
+ about_flags::ResetAllFlags(g_browser_process->local_state());
+}
+
} // namespace
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/resources/flags.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698