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

Unified Diff: chrome/browser/resources/flags.js

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/resources/flags.js
diff --git a/chrome/browser/resources/flags.js b/chrome/browser/resources/flags.js
index a819b86485129ebd5c3a143e6d5a99154328d388..30ad4f93cada3d3eccdba68fda0024c1aa2e6b8c 100644
--- a/chrome/browser/resources/flags.js
+++ b/chrome/browser/resources/flags.js
@@ -49,6 +49,8 @@ function renderTemplate(flagsExperimentsData) {
for (var i = 0; i < elements.length; ++i) {
elements[i].onclick = restartBrowser;
}
+
+ $('experiment-reset-all').onclick = resetAllExperiments;
}
/**
@@ -68,6 +70,15 @@ function restartBrowser() {
}
/**
+ * Reset all experiments to their default values and refresh the UI.
+ */
+function resetAllExperiments() {
+ // Asks the C++ FlagsDOMHandler to reset all experiments to default values.
+ chrome.send('resetAllExperiments');
+ requestFlagsExperimentsData();
+}
+
+/**
* Called by the WebUI to re-populate the page with data representing the
* current state of installed experiments.
* @param {Object} flagsExperimentsData Information about available experiments

Powered by Google App Engine
This is Rietveld 408576698