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

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

Issue 2678623002: DevTools: pass title when creating settings (Closed)
Patch Set: ac Created 3 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 | « third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e984f35dbe641ed86e36ac3ec2ebc9bb42a72a0f..e0dfe627d834137740414efaaa038007529be8d0 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
@@ -1005,18 +1005,15 @@ UI.ToolbarSettingComboBox = class extends UI.ToolbarComboBox {
UI.ToolbarCheckbox = class extends UI.ToolbarItem {
/**
* @param {string} text
- * @param {string=} title
- * @param {!Common.Setting=} setting
+ * @param {string=} tooltip
* @param {function()=} listener
*/
- constructor(text, title, setting, listener) {
+ constructor(text, tooltip, listener) {
super(UI.createCheckboxLabel(text));
this.element.classList.add('checkbox');
this.inputElement = this.element.checkboxElement;
- if (title)
- this.element.title = title;
- if (setting)
- UI.SettingsUI.bindCheckbox(this.inputElement, setting);
+ if (tooltip)
+ this.element.title = tooltip;
if (listener)
this.inputElement.addEventListener('click', listener, false);
}
@@ -1044,3 +1041,15 @@ UI.ToolbarCheckbox = class extends UI.ToolbarItem {
this.inputElement.disabled = !enabled;
}
};
+
+UI.ToolbarSettingCheckbox = class extends UI.ToolbarCheckbox {
+ /**
+ * @param {!Common.Setting} setting
+ * @param {string=} tooltip
+ * @param {string=} alternateTitle
+ */
+ constructor(setting, tooltip, alternateTitle) {
+ super(alternateTitle || setting.title() || '', tooltip);
+ UI.SettingsUI.bindCheckbox(this.inputElement, setting);
+ }
+};
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698