Skip to content

Commit 1d205ae

Browse files
ktranDevtools-frontend LUCI CQ
authored andcommitted
[uikit] Rename Icon helper from create to createIcon
This is a preparation for moving the icon component to the ui kit directory. With the new named import, `create` doesn't carry a lot of meaning (as opposed to IconButton.Icon.create), so rename to `createIcon` before moving. Bug: 464124289 Change-Id: I059a81a41d1f9dbd77e77424669da75a27295d94 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7204217 Commit-Queue: Kim-Anh Tran <[email protected]> Auto-Submit: Kim-Anh Tran <[email protected]> Reviewed-by: Simon Zünd <[email protected]>
1 parent f7498bd commit 1d205ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+105
-103
lines changed

front_end/panels/application/AppManifestView.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
676676
UI.ARIAUtils.setLabel(appIdField, 'App Id');
677677
appIdField.textContent = appId;
678678

679-
const helpIcon = IconButton.Icon.create('help', 'inline-icon');
679+
const helpIcon = IconButton.Icon.createIcon('help', 'inline-icon');
680680
helpIcon.title = i18nString(UIStrings.appIdExplainer);
681681
helpIcon.setAttribute('jslog', `${VisualLogging.action('help').track({hover: true})}`);
682682
appIdField.appendChild(helpIcon);
@@ -934,7 +934,7 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
934934
const wcoStatusMessage = this.windowControlsSection.appendRow();
935935

936936
if (hasWco) {
937-
const checkmarkIcon = IconButton.Icon.create('check-circle', 'inline-icon');
937+
const checkmarkIcon = IconButton.Icon.createIcon('check-circle', 'inline-icon');
938938
wcoStatusMessage.appendChild(checkmarkIcon);
939939

940940
const wco = document.createElement('code');
@@ -947,7 +947,7 @@ export class AppManifestView extends Common.ObjectWrapper.eventMixin<EventTypes,
947947
await this.appendWindowControlsToSection(this.overlayModel, url, stringProperty('theme_color'));
948948
}
949949
} else {
950-
const infoIcon = IconButton.Icon.create('info', 'inline-icon');
950+
const infoIcon = IconButton.Icon.createIcon('info', 'inline-icon');
951951

952952
wcoStatusMessage.appendChild(infoIcon);
953953

front_end/panels/application/ApplicationPanelSidebar.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
406406
i18nString(UIStrings.localStorageDescription), 'local-storage');
407407
this.localStorageListTreeElement.setLink(
408408
'https://developer.chrome.com/docs/devtools/storage/localstorage/' as Platform.DevToolsPath.UrlString);
409-
const localStorageIcon = IconButton.Icon.create('table');
409+
const localStorageIcon = IconButton.Icon.createIcon('table');
410410
this.localStorageListTreeElement.setLeadingIcons([localStorageIcon]);
411411

412412
storageTreeElement.appendChild(this.localStorageListTreeElement);
@@ -415,7 +415,7 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
415415
i18nString(UIStrings.sessionStorageDescription), 'session-storage');
416416
this.sessionStorageListTreeElement.setLink(
417417
'https://developer.chrome.com/docs/devtools/storage/sessionstorage/' as Platform.DevToolsPath.UrlString);
418-
const sessionStorageIcon = IconButton.Icon.create('table');
418+
const sessionStorageIcon = IconButton.Icon.createIcon('table');
419419
this.sessionStorageListTreeElement.setLeadingIcons([sessionStorageIcon]);
420420

421421
storageTreeElement.appendChild(this.sessionStorageListTreeElement);
@@ -425,7 +425,7 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
425425
i18nString(UIStrings.extensionStorageDescription), 'extension-storage');
426426
this.extensionStorageListTreeElement.setLink(
427427
'https://developer.chrome.com/docs/extensions/reference/api/storage/' as Platform.DevToolsPath.UrlString);
428-
const extensionStorageIcon = IconButton.Icon.create('table');
428+
const extensionStorageIcon = IconButton.Icon.createIcon('table');
429429
this.extensionStorageListTreeElement.setLeadingIcons([extensionStorageIcon]);
430430

431431
storageTreeElement.appendChild(this.extensionStorageListTreeElement);
@@ -440,7 +440,7 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
440440
'cookies');
441441
this.cookieListTreeElement.setLink(
442442
'https://developer.chrome.com/docs/devtools/storage/cookies/' as Platform.DevToolsPath.UrlString);
443-
const cookieIcon = IconButton.Icon.create('cookie');
443+
const cookieIcon = IconButton.Icon.createIcon('cookie');
444444
this.cookieListTreeElement.setLeadingIcons([cookieIcon]);
445445
storageTreeElement.appendChild(this.cookieListTreeElement);
446446

@@ -1064,7 +1064,7 @@ export class BackgroundServiceTreeElement extends ApplicationPanelTreeElement {
10641064

10651065
this.model = null;
10661066

1067-
const backgroundServiceIcon = IconButton.Icon.create(this.getIconType());
1067+
const backgroundServiceIcon = IconButton.Icon.createIcon(this.getIconType());
10681068
this.setLeadingIcons([backgroundServiceIcon]);
10691069
}
10701070

@@ -1130,7 +1130,7 @@ export class ServiceWorkersTreeElement extends ApplicationPanelTreeElement {
11301130

11311131
constructor(storagePanel: ResourcesPanel) {
11321132
super(storagePanel, i18n.i18n.lockedString('Service workers'), false, 'service-workers');
1133-
const icon = IconButton.Icon.create('gears');
1133+
const icon = IconButton.Icon.createIcon('gears');
11341134
this.setLeadingIcons([icon]);
11351135
}
11361136

@@ -1153,7 +1153,7 @@ export class AppManifestTreeElement extends ApplicationPanelTreeElement {
11531153
private view: AppManifestView;
11541154
constructor(storagePanel: ResourcesPanel) {
11551155
super(storagePanel, i18nString(UIStrings.manifest), true, 'manifest');
1156-
const icon = IconButton.Icon.create('document');
1156+
const icon = IconButton.Icon.createIcon('document');
11571157
this.setLeadingIcons([icon]);
11581158
self.onInvokeElement(this.listItemElement, this.onInvoke.bind(this));
11591159
const emptyView = new UI.EmptyWidget.EmptyWidget(
@@ -1207,7 +1207,7 @@ export class ManifestChildTreeElement extends ApplicationPanelTreeElement {
12071207
storagePanel: ResourcesPanel, element: Element, childTitle: string, fieldElement: HTMLElement,
12081208
jslogContext: string) {
12091209
super(storagePanel, childTitle, false, jslogContext);
1210-
const icon = IconButton.Icon.create('document');
1210+
const icon = IconButton.Icon.createIcon('document');
12111211
this.setLeadingIcons([icon]);
12121212
this.#sectionElement = element;
12131213
this.#sectionFieldElement = fieldElement;
@@ -1252,7 +1252,7 @@ export class ClearStorageTreeElement extends ApplicationPanelTreeElement {
12521252
private view?: StorageView;
12531253
constructor(storagePanel: ResourcesPanel) {
12541254
super(storagePanel, i18nString(UIStrings.storage), false, 'storage');
1255-
const icon = IconButton.Icon.create('database');
1255+
const icon = IconButton.Icon.createIcon('database');
12561256
this.setLeadingIcons([icon]);
12571257
}
12581258

@@ -1278,7 +1278,7 @@ export class IndexedDBTreeElement extends ExpandableApplicationPanelTreeElement
12781278
super(
12791279
storagePanel, i18nString(UIStrings.indexeddb), i18nString(UIStrings.noIndexeddb),
12801280
i18nString(UIStrings.indexeddbDescription), 'indexed-db');
1281-
const icon = IconButton.Icon.create('database');
1281+
const icon = IconButton.Icon.createIcon('database');
12821282
this.setLeadingIcons([icon]);
12831283
this.idbDatabaseTreeElements = [];
12841284
this.storageBucket = storageBucket;
@@ -1421,7 +1421,7 @@ export class IDBDatabaseTreeElement extends ApplicationPanelTreeElement {
14211421
this.model = model;
14221422
this.databaseId = databaseId;
14231423
this.idbObjectStoreTreeElements = new Map();
1424-
const icon = IconButton.Icon.create('database');
1424+
const icon = IconButton.Icon.createIcon('database');
14251425
this.setLeadingIcons([icon]);
14261426
this.model.addEventListener(IndexedDBModelEvents.DatabaseNamesRefreshed, this.refreshIndexedDB, this);
14271427
}
@@ -1546,7 +1546,7 @@ export class IDBObjectStoreTreeElement extends ApplicationPanelTreeElement {
15461546
this.idbIndexTreeElements = new Map();
15471547
this.objectStore = objectStore;
15481548
this.view = null;
1549-
const icon = IconButton.Icon.create('table');
1549+
const icon = IconButton.Icon.createIcon('table');
15501550
this.setLeadingIcons([icon]);
15511551
}
15521552

@@ -1758,7 +1758,7 @@ export class DOMStorageTreeElement extends ApplicationPanelTreeElement {
17581758
i18nString(UIStrings.localFiles),
17591759
false, domStorage.isLocalStorage ? 'local-storage-for-domain' : 'session-storage-for-domain');
17601760
this.domStorage = domStorage;
1761-
const icon = IconButton.Icon.create('table');
1761+
const icon = IconButton.Icon.createIcon('table');
17621762
this.setLeadingIcons([icon]);
17631763
}
17641764

@@ -1793,7 +1793,7 @@ export class ExtensionStorageTreeElement extends ApplicationPanelTreeElement {
17931793
super(
17941794
storagePanel, nameForExtensionStorageArea(extensionStorage.storageArea), false, 'extension-storage-for-domain');
17951795
this.extensionStorage = extensionStorage;
1796-
const icon = IconButton.Icon.create('table');
1796+
const icon = IconButton.Icon.createIcon('table');
17971797
this.setLeadingIcons([icon]);
17981798
}
17991799

@@ -1831,7 +1831,7 @@ export class ExtensionStorageTreeParentElement extends ApplicationPanelTreeEleme
18311831
constructor(storagePanel: ResourcesPanel, extensionId: string, extensionName: string) {
18321832
super(storagePanel, extensionName || extensionId, true, 'extension-storage-for-domain');
18331833
this.extensionId = extensionId;
1834-
const icon = IconButton.Icon.create('table');
1834+
const icon = IconButton.Icon.createIcon('table');
18351835
this.setLeadingIcons([icon]);
18361836
}
18371837

@@ -1851,7 +1851,7 @@ export class CookieTreeElement extends ApplicationPanelTreeElement {
18511851
this.target = frame.resourceTreeModel().target();
18521852
this.#cookieDomain = cookieUrl.securityOrigin();
18531853
this.tooltip = i18nString(UIStrings.cookiesUsedByFramesFromS, {PH1: this.#cookieDomain});
1854-
const icon = IconButton.Icon.create('cookie');
1854+
const icon = IconButton.Icon.createIcon('cookie');
18551855
// Note that we cannot use `cookieDomainInternal` here since it contains scheme.
18561856
if (IssuesManager.RelatedIssue.hasThirdPartyPhaseoutCookieIssueForDomain(cookieUrl.domain())) {
18571857
icon.name = 'warning-filled';
@@ -2172,7 +2172,7 @@ export class FrameTreeElement extends ApplicationPanelTreeElement {
21722172
}
21732173

21742174
async frameNavigated(frame: SDK.ResourceTreeModel.ResourceTreeFrame): Promise<void> {
2175-
const icon = IconButton.Icon.create(this.getIconTypeForFrame(frame));
2175+
const icon = IconButton.Icon.createIcon(this.getIconTypeForFrame(frame));
21762176
if (frame.unreachableUrl()) {
21772177
icon.classList.add('red-icon');
21782178
}
@@ -2374,7 +2374,7 @@ export class FrameResourceTreeElement extends ApplicationPanelTreeElement {
23742374
this.tooltip = resource.url;
23752375
resourceToFrameResourceTreeElement.set(this.resource, this);
23762376

2377-
const icon = IconButton.Icon.create('document', 'navigator-file-tree-item');
2377+
const icon = IconButton.Icon.createIcon('document', 'navigator-file-tree-item');
23782378
icon.classList.add('navigator-' + resource.resourceType().name() + '-tree-item');
23792379
this.setLeadingIcons([icon]);
23802380
}
@@ -2465,7 +2465,7 @@ class FrameWindowTreeElement extends ApplicationPanelTreeElement {
24652465

24662466
updateIcon(canAccessOpener: boolean): void {
24672467
const iconType = canAccessOpener ? 'popup' : 'frame';
2468-
const icon = IconButton.Icon.create(iconType);
2468+
const icon = IconButton.Icon.createIcon(iconType);
24692469
this.setLeadingIcons([icon]);
24702470
}
24712471

@@ -2514,7 +2514,7 @@ class WorkerTreeElement extends ApplicationPanelTreeElement {
25142514
super(storagePanel, targetInfo.title || targetInfo.url || i18nString(UIStrings.worker), false, 'worker');
25152515
this.targetInfo = targetInfo;
25162516
this.view = null;
2517-
const icon = IconButton.Icon.create('gears', 'navigator-file-tree-item');
2517+
const icon = IconButton.Icon.createIcon('gears', 'navigator-file-tree-item');
25182518
this.setLeadingIcons([icon]);
25192519
}
25202520

front_end/panels/application/BackForwardCacheTreeElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class BackForwardCacheTreeElement extends ApplicationPanelTreeElement {
2525

2626
constructor(resourcesPanel: ResourcesPanel) {
2727
super(resourcesPanel, i18nString(UIStrings.backForwardCache), false, 'bfcache');
28-
const icon = IconButton.Icon.create('database');
28+
const icon = IconButton.Icon.createIcon('database');
2929
this.setLeadingIcons([icon]);
3030
}
3131

front_end/panels/application/BounceTrackingMitigationsTreeElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class BounceTrackingMitigationsTreeElement extends ApplicationPanelTreeEl
2828

2929
constructor(resourcesPanel: ResourcesPanel) {
3030
super(resourcesPanel, i18nString(UIStrings.bounceTrackingMitigations), false, 'bounce-tracking-mitigations');
31-
const icon = IconButton.Icon.create('database');
31+
const icon = IconButton.Icon.createIcon('database');
3232
this.setLeadingIcons([icon]);
3333
}
3434

front_end/panels/application/InterestGroupTreeElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class InterestGroupTreeElement extends ApplicationPanelTreeElement {
3030

3131
constructor(storagePanel: ResourcesPanel) {
3232
super(storagePanel, i18nString(UIStrings.interestGroups), false, 'interest-groups');
33-
const interestGroupIcon = IconButton.Icon.create('database');
33+
const interestGroupIcon = IconButton.Icon.createIcon('database');
3434
this.setLeadingIcons([interestGroupIcon]);
3535
this.view = new InterestGroupStorageView(this);
3636
}

front_end/panels/application/OpenedWindowDetailsView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const booleanToYesNo = (b: boolean): Common.UIString.LocalizedString =>
9393
b ? i18nString(UIStrings.yes) : i18nString(UIStrings.no);
9494

9595
function linkifyIcon(iconType: string, title: string, eventHandler: () => (void|Promise<void>)): Element {
96-
const icon = IconButton.Icon.create(iconType, 'icon-link devtools-link');
96+
const icon = IconButton.Icon.createIcon(iconType, 'icon-link devtools-link');
9797
const button = document.createElement('button');
9898
UI.Tooltip.Tooltip.install(button, title);
9999
button.classList.add('devtools-link', 'link-style', 'text-button');

front_end/panels/application/PreloadingTreeElement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class PreloadingTreeElementBase<View extends PreloadingRuleSetView|PreloadingAtt
4545
this.#viewConstructor = viewConstructor;
4646
this.#path = path;
4747

48-
const icon = IconButton.Icon.create('speculative-loads');
48+
const icon = IconButton.Icon.createIcon('speculative-loads');
4949
this.setLeadingIcons([icon]);
5050
this.#selected = false;
5151

@@ -94,7 +94,7 @@ export class PreloadingSummaryTreeElement extends ExpandableApplicationPanelTree
9494
constructor(panel: ResourcesPanel) {
9595
super(panel, i18nString(UIStrings.speculativeLoads), '', '', 'preloading');
9696

97-
const icon = IconButton.Icon.create('speculative-loads');
97+
const icon = IconButton.Icon.createIcon('speculative-loads');
9898
this.setLeadingIcons([icon]);
9999
this.#selected = false;
100100

front_end/panels/application/ReportingApiTreeElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class ReportingApiTreeElement extends ApplicationPanelTreeElement {
2525

2626
constructor(storagePanel: ResourcesPanel) {
2727
super(storagePanel, i18nString(UIStrings.reportingApi), false, 'reporting-api');
28-
const icon = IconButton.Icon.create('document');
28+
const icon = IconButton.Icon.createIcon('document');
2929
this.setLeadingIcons([icon]);
3030
}
3131

front_end/panels/application/ServiceWorkerCacheTreeElement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class ServiceWorkerCacheTreeElement extends ExpandableApplicationPanelTre
4848
super(
4949
resourcesPanel, i18nString(UIStrings.cacheStorage), i18nString(UIStrings.noCacheStorage),
5050
i18nString(UIStrings.cacheStorageDescription), 'cache-storage');
51-
const icon = IconButton.Icon.create('database');
51+
const icon = IconButton.Icon.createIcon('database');
5252
this.setLink('https://developer.chrome.com/docs/devtools/storage/cache/' as Platform.DevToolsPath.UrlString);
5353
this.setLeadingIcons([icon]);
5454
this.swCacheModels = new Set();
@@ -175,7 +175,7 @@ export class SWCacheTreeElement extends ApplicationPanelTreeElement {
175175
this.model = model;
176176
this.cache = cache;
177177
this.view = null;
178-
const icon = IconButton.Icon.create('table');
178+
const icon = IconButton.Icon.createIcon('table');
179179
this.setLeadingIcons([icon]);
180180
}
181181

front_end/panels/application/SharedStorageListTreeElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class SharedStorageListTreeElement extends ApplicationPanelTreeElement {
2929
super(resourcesPanel, i18nString(UIStrings.sharedStorage), false, 'shared-storage');
3030
this.#expandedSetting =
3131
Common.Settings.Settings.instance().createSetting('resources-shared-storage-expanded', expandedSettingsDefault);
32-
const sharedStorageIcon = IconButton.Icon.create('database');
32+
const sharedStorageIcon = IconButton.Icon.createIcon('database');
3333
this.setLeadingIcons([sharedStorageIcon]);
3434
this.view = new SharedStorageEventsView();
3535
}

0 commit comments

Comments
 (0)