chrome-devtools-frontend 1.0.921565 → 1.0.922782
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/common/Settings.ts +8 -1
- package/front_end/core/i18n/locales/af.json +53 -32
- package/front_end/core/i18n/locales/am.json +56 -35
- package/front_end/core/i18n/locales/ar.json +53 -32
- package/front_end/core/i18n/locales/as.json +63 -42
- package/front_end/core/i18n/locales/az.json +53 -32
- package/front_end/core/i18n/locales/be.json +52 -31
- package/front_end/core/i18n/locales/bg.json +51 -30
- package/front_end/core/i18n/locales/bn.json +63 -42
- package/front_end/core/i18n/locales/bs.json +57 -36
- package/front_end/core/i18n/locales/ca.json +55 -34
- package/front_end/core/i18n/locales/cs.json +51 -30
- package/front_end/core/i18n/locales/cy.json +63 -42
- package/front_end/core/i18n/locales/da.json +55 -34
- package/front_end/core/i18n/locales/de.json +52 -31
- package/front_end/core/i18n/locales/el.json +58 -37
- package/front_end/core/i18n/locales/en-GB.json +51 -30
- package/front_end/core/i18n/locales/es-419.json +53 -32
- package/front_end/core/i18n/locales/es.json +52 -31
- package/front_end/core/i18n/locales/et.json +54 -33
- package/front_end/core/i18n/locales/eu.json +71 -50
- package/front_end/core/i18n/locales/fa.json +54 -33
- package/front_end/core/i18n/locales/fi.json +55 -34
- package/front_end/core/i18n/locales/fil.json +59 -38
- package/front_end/core/i18n/locales/fr-CA.json +52 -31
- package/front_end/core/i18n/locales/fr.json +54 -33
- package/front_end/core/i18n/locales/gl.json +57 -36
- package/front_end/core/i18n/locales/gu.json +65 -44
- package/front_end/core/i18n/locales/he.json +56 -35
- package/front_end/core/i18n/locales/hi.json +61 -40
- package/front_end/core/i18n/locales/hr.json +55 -34
- package/front_end/core/i18n/locales/hu.json +53 -32
- package/front_end/core/i18n/locales/hy.json +54 -33
- package/front_end/core/i18n/locales/id.json +59 -38
- package/front_end/core/i18n/locales/is.json +51 -30
- package/front_end/core/i18n/locales/it.json +51 -30
- package/front_end/core/i18n/locales/ja.json +52 -31
- package/front_end/core/i18n/locales/ka.json +51 -30
- package/front_end/core/i18n/locales/kk.json +56 -35
- package/front_end/core/i18n/locales/km.json +59 -38
- package/front_end/core/i18n/locales/kn.json +63 -42
- package/front_end/core/i18n/locales/ko.json +59 -38
- package/front_end/core/i18n/locales/ky.json +54 -33
- package/front_end/core/i18n/locales/lo.json +59 -38
- package/front_end/core/i18n/locales/lt.json +52 -31
- package/front_end/core/i18n/locales/lv.json +60 -39
- package/front_end/core/i18n/locales/mk.json +51 -30
- package/front_end/core/i18n/locales/ml.json +65 -44
- package/front_end/core/i18n/locales/mn.json +59 -38
- package/front_end/core/i18n/locales/mr.json +61 -40
- package/front_end/core/i18n/locales/ms.json +59 -38
- package/front_end/core/i18n/locales/my.json +59 -38
- package/front_end/core/i18n/locales/ne.json +63 -42
- package/front_end/core/i18n/locales/nl.json +55 -34
- package/front_end/core/i18n/locales/no.json +54 -33
- package/front_end/core/i18n/locales/or.json +63 -42
- package/front_end/core/i18n/locales/pa.json +61 -40
- package/front_end/core/i18n/locales/pl.json +51 -30
- package/front_end/core/i18n/locales/pt-PT.json +52 -31
- package/front_end/core/i18n/locales/pt.json +59 -38
- package/front_end/core/i18n/locales/ro.json +52 -31
- package/front_end/core/i18n/locales/ru.json +52 -31
- package/front_end/core/i18n/locales/si.json +59 -38
- package/front_end/core/i18n/locales/sk.json +52 -31
- package/front_end/core/i18n/locales/sl.json +52 -31
- package/front_end/core/i18n/locales/sq.json +51 -30
- package/front_end/core/i18n/locales/sr-Latn.json +52 -31
- package/front_end/core/i18n/locales/sr.json +52 -31
- package/front_end/core/i18n/locales/sv.json +52 -31
- package/front_end/core/i18n/locales/sw.json +60 -39
- package/front_end/core/i18n/locales/ta.json +67 -46
- package/front_end/core/i18n/locales/te.json +62 -41
- package/front_end/core/i18n/locales/th.json +52 -31
- package/front_end/core/i18n/locales/tr.json +55 -34
- package/front_end/core/i18n/locales/uk.json +55 -34
- package/front_end/core/i18n/locales/ur.json +60 -39
- package/front_end/core/i18n/locales/uz.json +52 -31
- package/front_end/core/i18n/locales/vi.json +54 -33
- package/front_end/core/i18n/locales/zh-HK.json +52 -31
- package/front_end/core/i18n/locales/zh-TW.json +57 -36
- package/front_end/core/i18n/locales/zh.json +56 -35
- package/front_end/core/i18n/locales/zu.json +59 -38
- package/front_end/core/sdk/FrameManager.ts +2 -2
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -1
- package/front_end/entrypoints/js_app/JsMain.ts +1 -1
- package/front_end/entrypoints/node_main/NodeMain.ts +1 -1
- package/front_end/entrypoints/worker_app/WorkerMain.ts +1 -1
- package/front_end/models/emulation/DeviceModeModel.ts +1 -1
- package/front_end/models/timeline_model/TimelineModel.ts +5 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +8 -7
- package/front_end/panels/application/DatabaseQueryView.ts +7 -1
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/changes/ChangesSidebar.ts +6 -1
- package/front_end/panels/console/ConsolePrompt.ts +6 -1
- package/front_end/panels/console/ConsoleSidebar.ts +5 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +2 -2
- package/front_end/panels/coverage/CoverageView.ts +5 -4
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +59 -48
- package/front_end/panels/css_overview/CSSOverviewController.ts +48 -8
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +1 -1
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +8 -1
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +14 -12
- package/front_end/panels/elements/ElementsPanel.ts +10 -8
- package/front_end/panels/elements/ElementsTreeOutline.ts +8 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +12 -2
- package/front_end/panels/emulation/AdvancedApp.ts +2 -12
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +14 -1
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +7 -1
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +4 -4
- package/front_end/panels/layer_viewer/Layers3DView.ts +7 -1
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +7 -1
- package/front_end/panels/layers/LayersPanel.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +1 -2
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +4 -0
- package/front_end/panels/network/NetworkDataGridNode.ts +46 -104
- package/front_end/panels/network/NetworkItemView.ts +2 -6
- package/front_end/panels/network/NetworkLogView.ts +4 -4
- package/front_end/panels/network/NetworkPanel.ts +12 -18
- package/front_end/panels/profiler/CPUProfileFlameChart.ts +26 -11
- package/front_end/panels/profiler/HeapProfileView.ts +5 -6
- package/front_end/panels/profiler/HeapSnapshotView.ts +6 -6
- package/front_end/panels/profiler/HeapTimelineOverview.ts +17 -3
- package/front_end/panels/profiler/ProfileLauncherView.ts +6 -1
- package/front_end/panels/profiler/ProfileView.ts +1 -1
- package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
- package/front_end/panels/settings/SettingsScreen.ts +2 -2
- package/front_end/panels/sources/CSSPlugin.ts +6 -6
- package/front_end/panels/sources/DebuggerPlugin.ts +4 -5
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +7 -5
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +5 -5
- package/front_end/panels/sources/OutlineQuickOpen.ts +7 -2
- package/front_end/panels/sources/ScriptFormatterEditorAction.ts +5 -6
- package/front_end/panels/sources/SourcesPanel.ts +2 -2
- package/front_end/panels/sources/SourcesView.ts +16 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +8 -13
- package/front_end/panels/sources/UISourceCodeFrame.ts +7 -1
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +2 -7
- package/front_end/panels/timeline/TimelineDetailsView.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -4
- package/front_end/panels/timeline/TimelineLayersView.ts +7 -7
- package/front_end/panels/timeline/TimelinePanel.ts +2 -1
- package/front_end/panels/timeline/TimelineTreeView.ts +6 -1
- package/front_end/ui/components/docs/toggle_fonts.ts +28 -1
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +4 -5
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +14 -5
- package/front_end/ui/legacy/Dialog.ts +12 -2
- package/front_end/ui/legacy/FilterBar.ts +12 -8
- package/front_end/ui/legacy/InspectorView.ts +3 -3
- package/front_end/ui/legacy/SplitWidget.ts +6 -1
- package/front_end/ui/legacy/TabbedPane.ts +9 -1
- package/front_end/ui/legacy/TextEditor.ts +12 -1
- package/front_end/ui/legacy/Treeoutline.ts +19 -11
- package/front_end/ui/legacy/ViewManager.ts +8 -7
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +6 -1
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +6 -1
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +7 -1
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +12 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +6 -6
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +8 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +9 -1
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +13 -3
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +14 -3
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -4
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +13 -3
- package/front_end/ui/legacy/components/quick_open/QuickInput.ts +4 -5
- package/front_end/ui/legacy/components/quick_open/QuickPick.ts +4 -5
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +29 -19
- package/front_end/ui/legacy/components/source_frame/SourcesTextEditor.ts +18 -2
- package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +3 -1
- package/front_end/ui/legacy/splitWidget.css +2 -2
- package/package.json +1 -1
- package/scripts/build/generate_css_js_files.js +1 -0
|
@@ -66,7 +66,8 @@ const UIStrings = {
|
|
|
66
66
|
};
|
|
67
67
|
const str_ = i18n.i18n.registerUIStrings('panels/profiler/ProfileLauncherView.ts', UIStrings);
|
|
68
68
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
69
|
-
export class ProfileLauncherView extends UI.Widget.VBox
|
|
69
|
+
export class ProfileLauncherView extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(
|
|
70
|
+
UI.Widget.VBox) {
|
|
70
71
|
readonly panel: ProfilesPanel;
|
|
71
72
|
private contentElementInternal: HTMLElement;
|
|
72
73
|
readonly selectedProfileTypeSetting: Common.Settings.Setting<string>;
|
|
@@ -232,3 +233,7 @@ export class ProfileLauncherView extends UI.Widget.VBox {
|
|
|
232
233
|
export enum Events {
|
|
233
234
|
ProfileTypeSelected = 'ProfileTypeSelected',
|
|
234
235
|
}
|
|
236
|
+
|
|
237
|
+
export type EventTypes = {
|
|
238
|
+
[Events.ProfileTypeSelected]: ProfileType,
|
|
239
|
+
};
|
|
@@ -413,7 +413,7 @@ export class ProfileView extends UI.View.SimpleView implements UI.SearchableView
|
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
-
async onEntryInvoked(event: Common.EventTarget.EventTargetEvent): Promise<void> {
|
|
416
|
+
async onEntryInvoked(event: Common.EventTarget.EventTargetEvent<number>): Promise<void> {
|
|
417
417
|
if (!this.dataProvider) {
|
|
418
418
|
return;
|
|
419
419
|
}
|
|
@@ -282,8 +282,8 @@ export class ProfilesPanel extends UI.Panel.PanelWithSidebar implements DataDisp
|
|
|
282
282
|
this.launcherView.profileFinished();
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
onProfileTypeSelected(event: Common.EventTarget.EventTargetEvent): void {
|
|
286
|
-
this.selectedProfileType =
|
|
285
|
+
onProfileTypeSelected(event: Common.EventTarget.EventTargetEvent<ProfileType>): void {
|
|
286
|
+
this.selectedProfileType = event.data;
|
|
287
287
|
this.updateProfileTypeSpecificUI();
|
|
288
288
|
}
|
|
289
289
|
|
|
@@ -193,8 +193,8 @@ export class SettingsScreen extends UI.Widget.VBox implements UI.View.ViewLocati
|
|
|
193
193
|
this.tabbedLocation.tabbedPane().selectTab(name, /* userGesture */ true);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
private tabInvoked(event: Common.EventTarget.EventTargetEvent): void {
|
|
197
|
-
const eventData = event.data
|
|
196
|
+
private tabInvoked(event: Common.EventTarget.EventTargetEvent<UI.TabbedPane.EventData>): void {
|
|
197
|
+
const eventData = event.data;
|
|
198
198
|
if (!eventData.isUserGesture) {
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
@@ -261,12 +261,12 @@ export class CSSPlugin extends Plugin {
|
|
|
261
261
|
this.swatchPopoverHelper.show(this.spectrum, swatch, this.swatchPopoverHidden.bind(this));
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
private spectrumResized(_event: Common.EventTarget.EventTargetEvent): void {
|
|
264
|
+
private spectrumResized(_event: Common.EventTarget.EventTargetEvent<void>): void {
|
|
265
265
|
this.swatchPopoverHelper.reposition();
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
private spectrumChanged(event: Common.EventTarget.EventTargetEvent): void {
|
|
269
|
-
const colorString =
|
|
268
|
+
private spectrumChanged(event: Common.EventTarget.EventTargetEvent<string>): void {
|
|
269
|
+
const colorString = event.data;
|
|
270
270
|
const color = Common.Color.Color.parse(colorString);
|
|
271
271
|
if (!color || !this.currentSwatch) {
|
|
272
272
|
return;
|
|
@@ -291,8 +291,8 @@ export class CSSPlugin extends Plugin {
|
|
|
291
291
|
this.swatchPopoverHelper.show(this.bezierEditor, swatch.iconElement(), this.swatchPopoverHidden.bind(this));
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
private bezierChanged(event: Common.EventTarget.EventTargetEvent): void {
|
|
295
|
-
const bezierString =
|
|
294
|
+
private bezierChanged(event: Common.EventTarget.EventTargetEvent<string>): void {
|
|
295
|
+
const bezierString = event.data;
|
|
296
296
|
if (this.currentSwatch instanceof InlineEditor.Swatches.BezierSwatch) {
|
|
297
297
|
this.currentSwatch.setBezierText(bezierString);
|
|
298
298
|
}
|
|
@@ -313,7 +313,7 @@ export class CSSPlugin extends Plugin {
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
private onTextChanged(event: Common.EventTarget.EventTargetEvent): void {
|
|
316
|
+
private onTextChanged(event: Common.EventTarget.EventTargetEvent<UI.TextEditor.TextChangedEvent>): void {
|
|
317
317
|
if (!this.muteSwatchProcessing) {
|
|
318
318
|
this.updateSwatches(event.data.newRange.startLine, event.data.newRange.endLine);
|
|
319
319
|
}
|
|
@@ -1812,17 +1812,16 @@ export class DebuggerPlugin extends Plugin {
|
|
|
1812
1812
|
this.textEditor.attachInfobar(this.prettyPrintInfobar);
|
|
1813
1813
|
}
|
|
1814
1814
|
|
|
1815
|
-
private async handleGutterClick(
|
|
1815
|
+
private async handleGutterClick(
|
|
1816
|
+
event: Common.EventTarget.EventTargetEvent<SourceFrame.SourcesTextEditor.GutterClickEventData>): Promise<void> {
|
|
1816
1817
|
if (this.muted) {
|
|
1817
1818
|
return;
|
|
1818
1819
|
}
|
|
1819
1820
|
|
|
1820
|
-
const
|
|
1821
|
-
if (
|
|
1821
|
+
const {gutterType, lineNumber: editorLineNumber, event: eventObject} = event.data;
|
|
1822
|
+
if (gutterType !== SourceFrame.SourcesTextEditor.lineNumbersGutterType) {
|
|
1822
1823
|
return;
|
|
1823
1824
|
}
|
|
1824
|
-
const editorLineNumber = eventData.lineNumber;
|
|
1825
|
-
const eventObject = eventData.event;
|
|
1826
1825
|
|
|
1827
1826
|
if (eventObject.button !== 0 || eventObject.altKey || eventObject.ctrlKey || eventObject.metaKey) {
|
|
1828
1827
|
return;
|
|
@@ -51,12 +51,14 @@ export class EditingLocationHistoryManager {
|
|
|
51
51
|
SourceFrame.SourcesTextEditor.Events.JumpHappened, this.onJumpHappened.bind(this));
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
private onJumpHappened(event: Common.EventTarget.EventTargetEvent):
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
private onJumpHappened(event: Common.EventTarget.EventTargetEvent<SourceFrame.SourcesTextEditor.JumpHappenedEvent>):
|
|
55
|
+
void {
|
|
56
|
+
const {from, to} = event.data;
|
|
57
|
+
if (from) {
|
|
58
|
+
this.updateActiveState(from);
|
|
57
59
|
}
|
|
58
|
-
if (
|
|
59
|
-
this.pushActiveState(
|
|
60
|
+
if (to) {
|
|
61
|
+
this.pushActiveState(to);
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -10,7 +10,7 @@ import type * as Workspace from '../../models/workspace/workspace.js';
|
|
|
10
10
|
import type * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
11
11
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
12
|
|
|
13
|
-
import type {EditorAction, SourcesView} from './SourcesView.js';
|
|
13
|
+
import type {EditorAction, EditorClosedEvent, SourcesView} from './SourcesView.js';
|
|
14
14
|
import {Events, registerEditorAction} from './SourcesView.js';
|
|
15
15
|
|
|
16
16
|
const UIStrings = {
|
|
@@ -45,13 +45,13 @@ export class InplaceFormatterEditorAction implements EditorAction {
|
|
|
45
45
|
return inplaceFormatterEditorActionInstance;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
private editorSelected(event: Common.EventTarget.EventTargetEvent): void {
|
|
49
|
-
const uiSourceCode =
|
|
48
|
+
private editorSelected(event: Common.EventTarget.EventTargetEvent<Workspace.UISourceCode.UISourceCode>): void {
|
|
49
|
+
const uiSourceCode = event.data;
|
|
50
50
|
this.updateButton(uiSourceCode);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
private editorClosed(event: Common.EventTarget.EventTargetEvent): void {
|
|
54
|
-
const wasSelected =
|
|
53
|
+
private editorClosed(event: Common.EventTarget.EventTargetEvent<EditorClosedEvent>): void {
|
|
54
|
+
const {wasSelected} = event.data;
|
|
55
55
|
if (wasSelected) {
|
|
56
56
|
this.updateButton(null);
|
|
57
57
|
}
|
|
@@ -85,11 +85,16 @@ export class OutlineQuickOpen extends QuickOpen.FilteredListWidget.Provider {
|
|
|
85
85
|
return -item.line - 1;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
renderItem(itemIndex: number, query: string, titleElement: Element,
|
|
88
|
+
renderItem(itemIndex: number, query: string, titleElement: Element, _subtitleElement: Element): void {
|
|
89
89
|
const item = this.items[itemIndex];
|
|
90
90
|
titleElement.textContent = item.title + (item.subtitle ? item.subtitle : '');
|
|
91
91
|
QuickOpen.FilteredListWidget.FilteredListWidget.highlightRanges(titleElement, query);
|
|
92
|
-
|
|
92
|
+
|
|
93
|
+
const tagElement = (titleElement.parentElement?.parentElement?.createChild('span', 'tag') as HTMLElement);
|
|
94
|
+
if (!tagElement) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
tagElement.textContent = ':' + (item.line + 1);
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
selectItem(itemIndex: number|null, _promptValue: string): void {
|
|
@@ -10,7 +10,7 @@ import * as Workspace from '../../models/workspace/workspace.js';
|
|
|
10
10
|
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
11
11
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
12
|
|
|
13
|
-
import type {EditorAction, SourcesView} from './SourcesView.js';
|
|
13
|
+
import type {EditorAction, EditorClosedEvent, SourcesView} from './SourcesView.js';
|
|
14
14
|
import {Events, registerEditorAction} from './SourcesView.js';
|
|
15
15
|
|
|
16
16
|
const UIStrings = {
|
|
@@ -48,8 +48,8 @@ export class ScriptFormatterEditorAction implements EditorAction {
|
|
|
48
48
|
return scriptFormatterEditorActionInstance;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
private editorSelected(event: Common.EventTarget.EventTargetEvent): void {
|
|
52
|
-
const uiSourceCode =
|
|
51
|
+
private editorSelected(event: Common.EventTarget.EventTargetEvent<Workspace.UISourceCode.UISourceCode>): void {
|
|
52
|
+
const uiSourceCode = event.data;
|
|
53
53
|
this.updateButton(uiSourceCode);
|
|
54
54
|
|
|
55
55
|
if (this.isFormattableScript(uiSourceCode) && this.pathsToFormatOnLoad.has(uiSourceCode.url()) &&
|
|
@@ -58,9 +58,8 @@ export class ScriptFormatterEditorAction implements EditorAction {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
private async editorClosed(event: Common.EventTarget.EventTargetEvent): Promise<void> {
|
|
62
|
-
const uiSourceCode =
|
|
63
|
-
const wasSelected = (event.data.wasSelected as boolean);
|
|
61
|
+
private async editorClosed(event: Common.EventTarget.EventTargetEvent<EditorClosedEvent>): Promise<void> {
|
|
62
|
+
const {uiSourceCode, wasSelected} = event.data;
|
|
64
63
|
|
|
65
64
|
if (wasSelected) {
|
|
66
65
|
this.updateButton(null);
|
|
@@ -643,8 +643,8 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
|
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
645
|
|
|
646
|
-
private editorSelected(event: Common.EventTarget.EventTargetEvent): void {
|
|
647
|
-
const uiSourceCode =
|
|
646
|
+
private editorSelected(event: Common.EventTarget.EventTargetEvent<Workspace.UISourceCode.UISourceCode>): void {
|
|
647
|
+
const uiSourceCode = event.data;
|
|
648
648
|
if (this.editorView.mainWidget() &&
|
|
649
649
|
Common.Settings.Settings.instance().moduleSetting('autoRevealInNavigator').get()) {
|
|
650
650
|
this.revealInNavigator(uiSourceCode, true);
|
|
@@ -40,8 +40,8 @@ const UIStrings = {
|
|
|
40
40
|
const str_ = i18n.i18n.registerUIStrings('panels/sources/SourcesView.ts', UIStrings);
|
|
41
41
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
42
42
|
|
|
43
|
-
export class SourcesView extends UI.Widget.VBox
|
|
44
|
-
|
|
43
|
+
export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox)
|
|
44
|
+
implements TabbedEditorContainerDelegate, UI.SearchableView.Searchable, UI.SearchableView.Replaceable {
|
|
45
45
|
private placeholderOptionArray: {
|
|
46
46
|
element: HTMLElement,
|
|
47
47
|
handler: Function,
|
|
@@ -446,7 +446,10 @@ export class SourcesView extends UI.Widget.VBox implements TabbedEditorContainer
|
|
|
446
446
|
this.updateToolbarChangedListener();
|
|
447
447
|
this.updateScriptViewToolbarItems();
|
|
448
448
|
|
|
449
|
-
|
|
449
|
+
const currentFile = this.editorContainer.currentFile();
|
|
450
|
+
if (currentFile) {
|
|
451
|
+
this.dispatchEventToListeners(Events.EditorSelected, currentFile);
|
|
452
|
+
}
|
|
450
453
|
}
|
|
451
454
|
|
|
452
455
|
private removeToolbarChangedListener(): void {
|
|
@@ -581,6 +584,16 @@ export // TODO(crbug.com/1167717): Make this a const enum again
|
|
|
581
584
|
EditorSelected = 'EditorSelected',
|
|
582
585
|
}
|
|
583
586
|
|
|
587
|
+
export interface EditorClosedEvent {
|
|
588
|
+
uiSourceCode: Workspace.UISourceCode.UISourceCode;
|
|
589
|
+
wasSelected: boolean;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
export type EventTypes = {
|
|
593
|
+
[Events.EditorClosed]: EditorClosedEvent,
|
|
594
|
+
[Events.EditorSelected]: Workspace.UISourceCode.UISourceCode,
|
|
595
|
+
};
|
|
596
|
+
|
|
584
597
|
/**
|
|
585
598
|
* @interface
|
|
586
599
|
*/
|
|
@@ -236,11 +236,10 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
236
236
|
SourceFrame.SourcesTextEditor.Events.SelectionChanged, this.selectionChanged, this);
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
private scrollChanged(
|
|
239
|
+
private scrollChanged({data: lineNumber}: Common.EventTarget.EventTargetEvent<number>): void {
|
|
240
240
|
if (this.scrollTimer) {
|
|
241
241
|
clearTimeout(this.scrollTimer);
|
|
242
242
|
}
|
|
243
|
-
const lineNumber = (event.data as number);
|
|
244
243
|
this.scrollTimer = window.setTimeout(saveHistory.bind(this), 100);
|
|
245
244
|
if (this.currentFileInternal) {
|
|
246
245
|
this.history.updateScrollLineNumber(this.currentFileInternal.url(), lineNumber);
|
|
@@ -251,8 +250,7 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
251
250
|
}
|
|
252
251
|
}
|
|
253
252
|
|
|
254
|
-
private selectionChanged(
|
|
255
|
-
const range = (event.data as TextUtils.TextRange.TextRange);
|
|
253
|
+
private selectionChanged({data: range}: Common.EventTarget.EventTargetEvent<TextUtils.TextRange.TextRange>): void {
|
|
256
254
|
if (this.currentFileInternal) {
|
|
257
255
|
this.history.updateSelectionRange(this.currentFileInternal.url(), range);
|
|
258
256
|
}
|
|
@@ -511,10 +509,8 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
511
509
|
}
|
|
512
510
|
}
|
|
513
511
|
|
|
514
|
-
private tabClosed(event: Common.EventTarget.EventTargetEvent): void {
|
|
515
|
-
const tabId =
|
|
516
|
-
const userGesture = (event.data.isUserGesture as boolean);
|
|
517
|
-
|
|
512
|
+
private tabClosed(event: Common.EventTarget.EventTargetEvent<UI.TabbedPane.EventData>): void {
|
|
513
|
+
const {tabId, isUserGesture} = event.data;
|
|
518
514
|
const uiSourceCode = this.files.get(tabId);
|
|
519
515
|
if (this.currentFileInternal === uiSourceCode) {
|
|
520
516
|
this.removeViewListeners();
|
|
@@ -531,19 +527,18 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
531
527
|
|
|
532
528
|
this.dispatchEventToListeners(Events.EditorClosed, uiSourceCode);
|
|
533
529
|
|
|
534
|
-
if (
|
|
530
|
+
if (isUserGesture) {
|
|
535
531
|
this.editorClosedByUserAction(uiSourceCode);
|
|
536
532
|
}
|
|
537
533
|
}
|
|
538
534
|
}
|
|
539
535
|
|
|
540
|
-
private tabSelected(event: Common.EventTarget.EventTargetEvent): void {
|
|
541
|
-
const tabId =
|
|
542
|
-
const userGesture = (event.data.isUserGesture as boolean);
|
|
536
|
+
private tabSelected(event: Common.EventTarget.EventTargetEvent<UI.TabbedPane.EventData>): void {
|
|
537
|
+
const {tabId, isUserGesture} = event.data;
|
|
543
538
|
|
|
544
539
|
const uiSourceCode = this.files.get(tabId);
|
|
545
540
|
if (uiSourceCode) {
|
|
546
|
-
this.innerShowFile(uiSourceCode,
|
|
541
|
+
this.innerShowFile(uiSourceCode, isUserGesture);
|
|
547
542
|
}
|
|
548
543
|
}
|
|
549
544
|
|
|
@@ -51,7 +51,9 @@ import {ScriptOriginPlugin} from './ScriptOriginPlugin.js';
|
|
|
51
51
|
import {SnippetsPlugin} from './SnippetsPlugin.js';
|
|
52
52
|
import {SourcesPanel} from './SourcesPanel.js';
|
|
53
53
|
|
|
54
|
-
export class UISourceCodeFrame extends
|
|
54
|
+
export class UISourceCodeFrame extends
|
|
55
|
+
Common.ObjectWrapper.eventMixin<EventTypes, typeof SourceFrame.SourceFrame.SourceFrameImpl>(
|
|
56
|
+
SourceFrame.SourceFrame.SourceFrameImpl) {
|
|
55
57
|
private uiSourceCodeInternal: Workspace.UISourceCode.UISourceCode;
|
|
56
58
|
private readonly diff: SourceFrame.SourceCodeDiff.SourceCodeDiff|undefined;
|
|
57
59
|
private muteSourceCodeEvents: boolean;
|
|
@@ -919,3 +921,7 @@ function messageLevelComparator(a: Workspace.UISourceCode.Message, b: Workspace.
|
|
|
919
921
|
export enum Events {
|
|
920
922
|
ToolbarItemsChanged = 'ToolbarItemsChanged',
|
|
921
923
|
}
|
|
924
|
+
|
|
925
|
+
export type EventTypes = {
|
|
926
|
+
[Events.ToolbarItemsChanged]: void,
|
|
927
|
+
};
|
|
@@ -7,17 +7,12 @@
|
|
|
7
7
|
.watch-expression-delete-button {
|
|
8
8
|
position: absolute;
|
|
9
9
|
top: 5px;
|
|
10
|
-
right:
|
|
10
|
+
right: 16px;
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
opacity: 0%;
|
|
13
|
-
min-width: 20px;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
.watch-expression-header:hover .watch-expression-delete-button {
|
|
17
|
-
opacity: 50%;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.watch-expression-header:hover .watch-expression-delete-button:hover {
|
|
21
16
|
opacity: 100%;
|
|
22
17
|
}
|
|
23
18
|
|
|
@@ -101,7 +96,7 @@ li.watch-expression-tree-item {
|
|
|
101
96
|
}
|
|
102
97
|
|
|
103
98
|
li.watch-expression-tree-item:hover {
|
|
104
|
-
background-color: var(--color-background-elevation-
|
|
99
|
+
background-color: var(--color-background-elevation-1);
|
|
105
100
|
}
|
|
106
101
|
|
|
107
102
|
.watch-expression-header:focus-visible {
|
|
@@ -249,7 +249,7 @@ export class TimelineDetailsView extends UI.Widget.VBox {
|
|
|
249
249
|
this.updateContents();
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
private tabSelected(event: Common.EventTarget.EventTargetEvent): void {
|
|
252
|
+
private tabSelected(event: Common.EventTarget.EventTargetEvent<UI.TabbedPane.EventData>): void {
|
|
253
253
|
if (!event.data.isUserGesture) {
|
|
254
254
|
return;
|
|
255
255
|
}
|
|
@@ -150,8 +150,8 @@ export class TimelineFlameChartView extends UI.Widget.VBox implements PerfUI.Fla
|
|
|
150
150
|
private readonly countersView: CountersGraph;
|
|
151
151
|
private readonly detailsSplitWidget: UI.SplitWidget.SplitWidget;
|
|
152
152
|
private readonly detailsView: TimelineDetailsView;
|
|
153
|
-
private readonly onMainEntrySelected: (event?: Common.EventTarget.EventTargetEvent) => void;
|
|
154
|
-
private readonly onNetworkEntrySelected: (event?: Common.EventTarget.EventTargetEvent) => void;
|
|
153
|
+
private readonly onMainEntrySelected: (event?: Common.EventTarget.EventTargetEvent<number>) => void;
|
|
154
|
+
private readonly onNetworkEntrySelected: (event?: Common.EventTarget.EventTargetEvent<number>) => void;
|
|
155
155
|
private nextExtensionIndex: number;
|
|
156
156
|
private readonly boundRefresh: () => void;
|
|
157
157
|
private selectedTrack: TimelineModel.TimelineModel.Track|null;
|
|
@@ -361,9 +361,9 @@ export class TimelineFlameChartView extends UI.Widget.VBox implements PerfUI.Fla
|
|
|
361
361
|
this.mainFlameChart.scheduleUpdate();
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
-
private onEntryHighlighted(commonEvent: Common.EventTarget.EventTargetEvent): void {
|
|
364
|
+
private onEntryHighlighted(commonEvent: Common.EventTarget.EventTargetEvent<number>): void {
|
|
365
365
|
SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight();
|
|
366
|
-
const entryIndex =
|
|
366
|
+
const entryIndex = commonEvent.data;
|
|
367
367
|
const event = this.mainDataProvider.eventByIndex(entryIndex);
|
|
368
368
|
if (!event) {
|
|
369
369
|
return;
|
|
@@ -63,13 +63,13 @@ export class TimelineLayersView extends UI.SplitWidget.SplitWidget {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
private onPaintProfilerRequested(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
66
|
+
private async onPaintProfilerRequested(
|
|
67
|
+
event: Common.EventTarget.EventTargetEvent<LayerViewer.LayerViewHost.Selection>): Promise<void> {
|
|
68
|
+
const selection = event.data;
|
|
69
|
+
const snapshotWithRect = await this.layers3DView.snapshotForSelection(selection);
|
|
70
|
+
if (snapshotWithRect) {
|
|
71
|
+
this.showPaintProfilerCallback(snapshotWithRect.snapshot);
|
|
72
|
+
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
private update(): void {
|
|
@@ -448,7 +448,8 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
|
|
|
448
448
|
this.loader = TimelineLoader.loadFromEvents(events, this);
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
-
private onOverviewWindowChanged(
|
|
451
|
+
private onOverviewWindowChanged(
|
|
452
|
+
event: Common.EventTarget.EventTargetEvent<PerfUI.TimelineOverviewPane.WindowChangedEvent>): void {
|
|
452
453
|
if (!this.performanceModel) {
|
|
453
454
|
return;
|
|
454
455
|
}
|
|
@@ -1000,7 +1000,8 @@ export class BottomUpTimelineTreeView extends AggregatedTimelineTreeView {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
|
|
1003
|
-
export class TimelineStackView extends
|
|
1003
|
+
export class TimelineStackView extends
|
|
1004
|
+
Common.ObjectWrapper.eventMixin<TimelineStackView.EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox) {
|
|
1004
1005
|
private readonly treeView: TimelineTreeView;
|
|
1005
1006
|
private readonly dataGrid: DataGrid.ViewportDataGrid.ViewportDataGrid<unknown>;
|
|
1006
1007
|
|
|
@@ -1059,4 +1060,8 @@ export namespace TimelineStackView {
|
|
|
1059
1060
|
export enum Events {
|
|
1060
1061
|
SelectionChanged = 'SelectionChanged',
|
|
1061
1062
|
}
|
|
1063
|
+
|
|
1064
|
+
export type EventTypes = {
|
|
1065
|
+
[Events.SelectionChanged]: void,
|
|
1066
|
+
};
|
|
1062
1067
|
}
|
|
@@ -6,7 +6,28 @@ const PLATFORM_MAC_CLASS = 'platform-mac';
|
|
|
6
6
|
const PLATFORM_LINUX_CLASS = 'platform-linux';
|
|
7
7
|
const PLATFORM_WINDOWS_CLASS = 'platform-windows';
|
|
8
8
|
|
|
9
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
10
|
+
|
|
9
11
|
export function init(): void {
|
|
12
|
+
// fontFamily is provided by the interaction tests.
|
|
13
|
+
// While platform-specific class names define multiple font-families,
|
|
14
|
+
// we want a single font-family to be used by the tests.
|
|
15
|
+
if (urlParams.has('fontFamily')) {
|
|
16
|
+
const div = document.createElement('div');
|
|
17
|
+
div.style.position = 'fixed';
|
|
18
|
+
div.style.bottom = '10px';
|
|
19
|
+
div.style.right = '230px';
|
|
20
|
+
div.style.width = '250px';
|
|
21
|
+
div.style.fontSize = '16px';
|
|
22
|
+
div.style.padding = '5px';
|
|
23
|
+
div.innerText = `font-family: ${urlParams.get('fontFamily')}`;
|
|
24
|
+
window.addEventListener('load', () => {
|
|
25
|
+
document.body.appendChild(div);
|
|
26
|
+
});
|
|
27
|
+
document.body.style.fontFamily = `${urlParams.get('fontFamily')}`;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
10
31
|
document.body.classList.add(PLATFORM_LINUX_CLASS);
|
|
11
32
|
const button = document.createElement('button');
|
|
12
33
|
|
|
@@ -17,7 +38,13 @@ export function init(): void {
|
|
|
17
38
|
];
|
|
18
39
|
|
|
19
40
|
function toggleFonts(): void {
|
|
20
|
-
|
|
41
|
+
for (const className of loop) {
|
|
42
|
+
if (className === loop[0]) {
|
|
43
|
+
document.body.classList.add(className);
|
|
44
|
+
} else {
|
|
45
|
+
document.body.classList.remove(className);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
21
48
|
loop.push(loop.shift() as string);
|
|
22
49
|
button.innerText = 'Turn on ' + loop[0] + ' fonts';
|
|
23
50
|
}
|
|
@@ -9,7 +9,7 @@ import * as Protocol from '../../../generated/protocol.js';
|
|
|
9
9
|
import * as UI from '../../legacy/legacy.js';
|
|
10
10
|
|
|
11
11
|
import type {Settings} from './LinearMemoryInspector.js';
|
|
12
|
-
import {LinearMemoryInspectorPaneImpl} from './LinearMemoryInspectorPane.js';
|
|
12
|
+
import {Events as LmiEvents, LinearMemoryInspectorPaneImpl} from './LinearMemoryInspectorPane.js';
|
|
13
13
|
import type {ValueType, ValueTypeMode} from './ValueInterpreterDisplayUtils.js';
|
|
14
14
|
import {Endianness, getDefaultValueTypeMapping} from './ValueInterpreterDisplayUtils.js';
|
|
15
15
|
|
|
@@ -82,7 +82,7 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
|
|
|
82
82
|
SDK.TargetManager.TargetManager.instance().observeModels(SDK.RuntimeModel.RuntimeModel, this);
|
|
83
83
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
84
84
|
SDK.DebuggerModel.DebuggerModel, SDK.DebuggerModel.Events.GlobalObjectCleared, this.onGlobalObjectClear, this);
|
|
85
|
-
this.paneInstance.addEventListener(
|
|
85
|
+
this.paneInstance.addEventListener(LmiEvents.ViewClosed, this.viewClosed.bind(this));
|
|
86
86
|
|
|
87
87
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
88
88
|
SDK.DebuggerModel.DebuggerModel, SDK.DebuggerModel.Events.DebuggerPaused, this.onDebuggerPause, this);
|
|
@@ -202,12 +202,11 @@ export class LinearMemoryInspectorController extends SDK.TargetManager.SDKModelO
|
|
|
202
202
|
this.modelRemoved(event.data.runtimeModel());
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
private viewClosed(
|
|
206
|
-
const bufferId = event.data;
|
|
205
|
+
private viewClosed({data: bufferId}: Common.EventTarget.EventTargetEvent<string>): void {
|
|
207
206
|
const remoteObj = this.bufferIdToRemoteObject.get(bufferId);
|
|
208
207
|
if (remoteObj) {
|
|
209
208
|
remoteObj.release();
|
|
210
209
|
}
|
|
211
|
-
this.bufferIdToRemoteObject.delete(
|
|
210
|
+
this.bufferIdToRemoteObject.delete(bufferId);
|
|
212
211
|
}
|
|
213
212
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Common from '../../../core/common/common.js';
|
|
6
6
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
7
7
|
import * as UI from '../../legacy/legacy.js';
|
|
8
8
|
|
|
@@ -48,7 +48,8 @@ export class Wrapper extends UI.Widget.VBox {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
export class LinearMemoryInspectorPaneImpl extends UI.Widget.VBox
|
|
51
|
+
export class LinearMemoryInspectorPaneImpl extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(
|
|
52
|
+
UI.Widget.VBox) {
|
|
52
53
|
private readonly tabbedPane: UI.TabbedPane.TabbedPane;
|
|
53
54
|
private readonly tabIdToInspectorView: Map<string, LinearMemoryInspectorView>;
|
|
54
55
|
constructor() {
|
|
@@ -105,13 +106,21 @@ export class LinearMemoryInspectorPaneImpl extends UI.Widget.VBox {
|
|
|
105
106
|
view.refreshData();
|
|
106
107
|
}
|
|
107
108
|
|
|
108
|
-
private tabClosed(event: Common.EventTarget.EventTargetEvent): void {
|
|
109
|
-
const tabId = event.data
|
|
109
|
+
private tabClosed(event: Common.EventTarget.EventTargetEvent<UI.TabbedPane.EventData>): void {
|
|
110
|
+
const {tabId} = event.data;
|
|
110
111
|
this.tabIdToInspectorView.delete(tabId);
|
|
111
|
-
this.dispatchEventToListeners(
|
|
112
|
+
this.dispatchEventToListeners(Events.ViewClosed, tabId);
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
export const enum Events {
|
|
117
|
+
ViewClosed = 'ViewClosed',
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export type EventTypes = {
|
|
121
|
+
[Events.ViewClosed]: string,
|
|
122
|
+
};
|
|
123
|
+
|
|
115
124
|
class LinearMemoryInspectorView extends UI.Widget.VBox {
|
|
116
125
|
private memoryWrapper: LazyUint8Array;
|
|
117
126
|
private address: number;
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
+
import * as Common from '../../core/common/common.js';
|
|
32
|
+
|
|
31
33
|
import * as ARIAUtils from './ARIAUtils.js';
|
|
32
34
|
import {GlassPane, PointerEventsBehavior} from './GlassPane.js';
|
|
33
35
|
import {InspectorView} from './InspectorView.js';
|
|
@@ -37,7 +39,7 @@ import type {DevToolsCloseButton} from './UIUtils.js';
|
|
|
37
39
|
import type {WidgetElement} from './Widget.js';
|
|
38
40
|
import {WidgetFocusRestorer} from './Widget.js';
|
|
39
41
|
|
|
40
|
-
export class Dialog extends GlassPane {
|
|
42
|
+
export class Dialog extends Common.ObjectWrapper.eventMixin<EventTypes, typeof GlassPane>(GlassPane) {
|
|
41
43
|
private tabIndexBehavior: OutsideTabIndexBehavior;
|
|
42
44
|
private tabIndexMap: Map<HTMLElement, number>;
|
|
43
45
|
private focusRestorer: WidgetFocusRestorer|null;
|
|
@@ -94,7 +96,7 @@ export class Dialog extends GlassPane {
|
|
|
94
96
|
this.targetDocument.removeEventListener('keydown', this.targetDocumentKeyDownHandler, true);
|
|
95
97
|
}
|
|
96
98
|
this.restoreTabIndexOnElements();
|
|
97
|
-
this.dispatchEventToListeners(
|
|
99
|
+
this.dispatchEventToListeners(Events.Hidden);
|
|
98
100
|
Dialog.instance = null;
|
|
99
101
|
}
|
|
100
102
|
|
|
@@ -198,6 +200,14 @@ export class Dialog extends GlassPane {
|
|
|
198
200
|
private static instance: Dialog|null = null;
|
|
199
201
|
}
|
|
200
202
|
|
|
203
|
+
export const enum Events {
|
|
204
|
+
Hidden = 'hidden',
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export type EventTypes = {
|
|
208
|
+
[Events.Hidden]: void,
|
|
209
|
+
};
|
|
210
|
+
|
|
201
211
|
// TODO(crbug.com/1167717): Make this a const enum again
|
|
202
212
|
// eslint-disable-next-line rulesdir/const_enum
|
|
203
213
|
export enum OutsideTabIndexBehavior {
|