Skip to content

Commit 45f5c04

Browse files
danilsomsikovDevtools-frontend LUCI CQ
authored and
Devtools-frontend LUCI CQ
committed
Cleanup unused parameter from createWithStringLiteral
The method `createWithStringLiteral` has an optional parameter `subtitle` which isn't used by any caller, so removing the parameter and the passing it down. This is a preparation to removing such helpers altogether as these don't bring much value in lit templates Bug: 301364727 Change-Id: Iea989c7ab90fa6dfc9f504c45b647ebc9cc96d7f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6438858 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Danil Somsikov <dsv@chromium.org>
1 parent e068bd7 commit 45f5c04

File tree

7 files changed

+12
-14
lines changed

7 files changed

+12
-14
lines changed

front_end/panels/elements/ClassesPaneWidget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ export class ClassesPaneWidget extends UI.Widget.Widget {
180180
const keys = [...classes.keys()];
181181
keys.sort(Platform.StringUtilities.caseInsensetiveComparator);
182182
for (const className of keys) {
183-
const label = UI.UIUtils.CheckboxLabel.createWithStringLiteral(
184-
className, classes.get(className), undefined, 'element-class', true);
183+
const label =
184+
UI.UIUtils.CheckboxLabel.createWithStringLiteral(className, classes.get(className), 'element-class', true);
185185
label.classList.add('monospace');
186186
label.checkboxElement.addEventListener('click', this.onClick.bind(this, className), false);
187187
this.classesContainer.appendChild(label);

front_end/panels/elements/ElementStatePaneWidget.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ export class ElementStatePaneWidget extends UI.Widget.Widget {
112112
const createElementStateCheckbox = (state: string): HTMLDivElement => {
113113
const div = document.createElement('div');
114114
div.id = state;
115-
const label =
116-
UI.UIUtils.CheckboxLabel.createWithStringLiteral(':' + state, undefined, undefined, undefined, true);
115+
const label = UI.UIUtils.CheckboxLabel.createWithStringLiteral(':' + state, undefined, undefined, true);
117116
const input = label.checkboxElement;
118117
this.inputStates.set(input, state);
119118
input.addEventListener('click', (clickListener as EventListener), false);

front_end/panels/network/NetworkConfigView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export class NetworkConfigView extends UI.Widget.VBox {
340340
Zstd: Protocol.Network.ContentEncoding.Zstd,
341341
};
342342
for (const encoding of Object.values(contentEncodings)) {
343-
const label = UI.UIUtils.CheckboxLabel.createWithStringLiteral(encoding, true, undefined, encoding);
343+
const label = UI.UIUtils.CheckboxLabel.createWithStringLiteral(encoding, true, encoding);
344344
encodingsSection.appendChild(label);
345345
checkboxes.set(encoding, label.checkboxElement);
346346
}

front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ export class FrameworkIgnoreListSettingsTab extends UI.Widget.VBox implements
217217

218218
const listSetting = this.setting;
219219

220-
const checkbox = UI.UIUtils.CheckboxLabel.createWithStringLiteral(
221-
item.pattern, !item.disabled, undefined, 'settings.ignore-list-pattern');
220+
const checkbox =
221+
UI.UIUtils.CheckboxLabel.createWithStringLiteral(item.pattern, !item.disabled, 'settings.ignore-list-pattern');
222222
const helpText = i18nString(UIStrings.ignoreScriptsWhoseNamesMatchS, {PH1: item.pattern});
223223
UI.Tooltip.Tooltip.install(checkbox, helpText);
224224
checkbox.checkboxElement.ariaLabel = helpText;

front_end/panels/settings/SettingsScreen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ export class ExperimentsSettingsTab extends SettingsTab {
479479
}
480480

481481
private createExperimentCheckbox(experiment: Root.Runtime.Experiment): HTMLParagraphElement {
482-
const label = UI.UIUtils.CheckboxLabel.createWithStringLiteral(
483-
experiment.title, experiment.isEnabled(), undefined, experiment.name);
482+
const label =
483+
UI.UIUtils.CheckboxLabel.createWithStringLiteral(experiment.title, experiment.isEnabled(), experiment.name);
484484
label.classList.add('experiment-label');
485485
const input = label.checkboxElement;
486486
input.name = experiment.name;

front_end/panels/timeline/components/IgnoreListSetting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export class IgnoreListSetting extends HTMLElement {
246246

247247
#renderItem(regex: Common.Settings.RegExpSettingItem, index: number): Lit.TemplateResult {
248248
const checkboxWithLabel = UI.UIUtils.CheckboxLabel.createWithStringLiteral(
249-
regex.pattern, !regex.disabled, /* subtitle*/ undefined, /* jslogContext*/ 'timeline.ignore-list-pattern');
249+
regex.pattern, !regex.disabled, /* jslogContext*/ 'timeline.ignore-list-pattern');
250250
const helpText = i18nString(UIStrings.ignoreScriptsWhoseNamesMatchS, {regex: regex.pattern});
251251
UI.Tooltip.Tooltip.install(checkboxWithLabel, helpText);
252252
checkboxWithLabel.checkboxElement.ariaLabel = helpText;

front_end/ui/legacy/UIUtils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,11 +1343,10 @@ export class CheckboxLabel extends HTMLElement {
13431343
}
13441344

13451345
/** Only to be used when the checkbox label is 'generated' (a regex, a className, etc). Most checkboxes should be create()'d with UIStrings */
1346-
static createWithStringLiteral(
1347-
title?: string, checked?: boolean, subtitle?: Platform.UIString.LocalizedString, jslogContext?: string,
1348-
small?: boolean): CheckboxLabel {
1346+
static createWithStringLiteral(title?: string, checked?: boolean, jslogContext?: string, small?: boolean):
1347+
CheckboxLabel {
13491348
const stringLiteral = title as Platform.UIString.LocalizedString;
1350-
return CheckboxLabel.create(stringLiteral, checked, subtitle, jslogContext, small);
1349+
return CheckboxLabel.create(stringLiteral, checked, undefined, jslogContext, small);
13511350
}
13521351

13531352
private static lastId = 0;

0 commit comments

Comments
 (0)