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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js

Issue 1841863003: DevTools: move the force update SW on reload checkbox to the Resources / Service Workers view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
index c57e0cf7b49be7b0d2d769e054adf149f239d177..1544ee6efdccfb176d0ef703166b96588e95b474 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
@@ -889,8 +889,9 @@ WebInspector.ToolbarComboBox.prototype = {
* @param {string} text
* @param {string=} title
* @param {!WebInspector.Setting=} setting
+ * @param {function(boolean)=} updateCallback
*/
-WebInspector.ToolbarCheckbox = function(text, title, setting)
+WebInspector.ToolbarCheckbox = function(text, title, setting, updateCallback)
dgozman 2016/03/30 21:09:54 I don't see where you use this.
pfeldman 2016/03/31 05:02:31 I no longer am. Done.
{
WebInspector.ToolbarItem.call(this, createCheckboxLabel(text));
this.element.classList.add("checkbox");
@@ -899,6 +900,8 @@ WebInspector.ToolbarCheckbox = function(text, title, setting)
this.element.title = title;
if (setting)
WebInspector.SettingsUI.bindCheckbox(this.inputElement, setting);
+ if (updateCallback)
+ this.inputElement.addEventListener("click", () => updateCallback(this.checked()), false);
}
WebInspector.ToolbarCheckbox.prototype = {
@@ -910,6 +913,14 @@ WebInspector.ToolbarCheckbox.prototype = {
return this.inputElement.checked;
},
+ /**
+ * @param {boolean} checked
+ */
+ setChecked: function(checked)
+ {
+ this.inputElement.checked = checked;
+ },
+
__proto__: WebInspector.ToolbarItem.prototype
}

Powered by Google App Engine
This is Rietveld 408576698