Chromium Code Reviews| 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 |
| } |