chrome-devtools-frontend 1.0.921565 → 1.0.922044

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.
Files changed (114) hide show
  1. package/front_end/core/i18n/locales/af.json +53 -32
  2. package/front_end/core/i18n/locales/am.json +56 -35
  3. package/front_end/core/i18n/locales/ar.json +53 -32
  4. package/front_end/core/i18n/locales/as.json +63 -42
  5. package/front_end/core/i18n/locales/az.json +53 -32
  6. package/front_end/core/i18n/locales/be.json +52 -31
  7. package/front_end/core/i18n/locales/bg.json +51 -30
  8. package/front_end/core/i18n/locales/bn.json +63 -42
  9. package/front_end/core/i18n/locales/bs.json +57 -36
  10. package/front_end/core/i18n/locales/ca.json +55 -34
  11. package/front_end/core/i18n/locales/cs.json +51 -30
  12. package/front_end/core/i18n/locales/cy.json +63 -42
  13. package/front_end/core/i18n/locales/da.json +55 -34
  14. package/front_end/core/i18n/locales/de.json +52 -31
  15. package/front_end/core/i18n/locales/el.json +58 -37
  16. package/front_end/core/i18n/locales/en-GB.json +51 -30
  17. package/front_end/core/i18n/locales/es-419.json +53 -32
  18. package/front_end/core/i18n/locales/es.json +52 -31
  19. package/front_end/core/i18n/locales/et.json +54 -33
  20. package/front_end/core/i18n/locales/eu.json +71 -50
  21. package/front_end/core/i18n/locales/fa.json +54 -33
  22. package/front_end/core/i18n/locales/fi.json +55 -34
  23. package/front_end/core/i18n/locales/fil.json +59 -38
  24. package/front_end/core/i18n/locales/fr-CA.json +52 -31
  25. package/front_end/core/i18n/locales/fr.json +54 -33
  26. package/front_end/core/i18n/locales/gl.json +57 -36
  27. package/front_end/core/i18n/locales/gu.json +65 -44
  28. package/front_end/core/i18n/locales/he.json +56 -35
  29. package/front_end/core/i18n/locales/hi.json +61 -40
  30. package/front_end/core/i18n/locales/hr.json +55 -34
  31. package/front_end/core/i18n/locales/hu.json +53 -32
  32. package/front_end/core/i18n/locales/hy.json +54 -33
  33. package/front_end/core/i18n/locales/id.json +59 -38
  34. package/front_end/core/i18n/locales/is.json +51 -30
  35. package/front_end/core/i18n/locales/it.json +51 -30
  36. package/front_end/core/i18n/locales/ja.json +52 -31
  37. package/front_end/core/i18n/locales/ka.json +51 -30
  38. package/front_end/core/i18n/locales/kk.json +56 -35
  39. package/front_end/core/i18n/locales/km.json +59 -38
  40. package/front_end/core/i18n/locales/kn.json +63 -42
  41. package/front_end/core/i18n/locales/ko.json +59 -38
  42. package/front_end/core/i18n/locales/ky.json +54 -33
  43. package/front_end/core/i18n/locales/lo.json +59 -38
  44. package/front_end/core/i18n/locales/lt.json +52 -31
  45. package/front_end/core/i18n/locales/lv.json +60 -39
  46. package/front_end/core/i18n/locales/mk.json +51 -30
  47. package/front_end/core/i18n/locales/ml.json +65 -44
  48. package/front_end/core/i18n/locales/mn.json +59 -38
  49. package/front_end/core/i18n/locales/mr.json +61 -40
  50. package/front_end/core/i18n/locales/ms.json +59 -38
  51. package/front_end/core/i18n/locales/my.json +59 -38
  52. package/front_end/core/i18n/locales/ne.json +63 -42
  53. package/front_end/core/i18n/locales/nl.json +55 -34
  54. package/front_end/core/i18n/locales/no.json +54 -33
  55. package/front_end/core/i18n/locales/or.json +63 -42
  56. package/front_end/core/i18n/locales/pa.json +61 -40
  57. package/front_end/core/i18n/locales/pl.json +51 -30
  58. package/front_end/core/i18n/locales/pt-PT.json +52 -31
  59. package/front_end/core/i18n/locales/pt.json +59 -38
  60. package/front_end/core/i18n/locales/ro.json +52 -31
  61. package/front_end/core/i18n/locales/ru.json +52 -31
  62. package/front_end/core/i18n/locales/si.json +59 -38
  63. package/front_end/core/i18n/locales/sk.json +52 -31
  64. package/front_end/core/i18n/locales/sl.json +52 -31
  65. package/front_end/core/i18n/locales/sq.json +51 -30
  66. package/front_end/core/i18n/locales/sr-Latn.json +52 -31
  67. package/front_end/core/i18n/locales/sr.json +52 -31
  68. package/front_end/core/i18n/locales/sv.json +52 -31
  69. package/front_end/core/i18n/locales/sw.json +60 -39
  70. package/front_end/core/i18n/locales/ta.json +67 -46
  71. package/front_end/core/i18n/locales/te.json +62 -41
  72. package/front_end/core/i18n/locales/th.json +52 -31
  73. package/front_end/core/i18n/locales/tr.json +55 -34
  74. package/front_end/core/i18n/locales/uk.json +55 -34
  75. package/front_end/core/i18n/locales/ur.json +60 -39
  76. package/front_end/core/i18n/locales/uz.json +52 -31
  77. package/front_end/core/i18n/locales/vi.json +54 -33
  78. package/front_end/core/i18n/locales/zh-HK.json +52 -31
  79. package/front_end/core/i18n/locales/zh-TW.json +57 -36
  80. package/front_end/core/i18n/locales/zh.json +56 -35
  81. package/front_end/core/i18n/locales/zu.json +59 -38
  82. package/front_end/models/timeline_model/TimelineModel.ts +5 -1
  83. package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -2
  84. package/front_end/panels/application/DatabaseQueryView.ts +7 -1
  85. package/front_end/panels/changes/ChangesSidebar.ts +6 -1
  86. package/front_end/panels/console/ConsolePrompt.ts +6 -1
  87. package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +2 -2
  88. package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +8 -1
  89. package/front_end/panels/elements/ElementsPanel.ts +2 -1
  90. package/front_end/panels/elements/StylesSidebarPane.ts +12 -2
  91. package/front_end/panels/emulation/AdvancedApp.ts +2 -12
  92. package/front_end/panels/emulation/InspectedPagePlaceholder.ts +14 -1
  93. package/front_end/panels/layer_viewer/LayerDetailsView.ts +7 -1
  94. package/front_end/panels/layer_viewer/Layers3DView.ts +7 -1
  95. package/front_end/panels/layer_viewer/PaintProfilerView.ts +7 -1
  96. package/front_end/panels/network/NetworkPanel.ts +7 -6
  97. package/front_end/panels/profiler/CPUProfileFlameChart.ts +3 -3
  98. package/front_end/panels/profiler/ProfileLauncherView.ts +6 -1
  99. package/front_end/panels/profiler/ProfileView.ts +1 -1
  100. package/front_end/panels/profiler/ProfilesPanel.ts +2 -2
  101. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +5 -5
  102. package/front_end/panels/sources/ScriptFormatterEditorAction.ts +5 -6
  103. package/front_end/panels/sources/SourcesPanel.ts +2 -2
  104. package/front_end/panels/sources/SourcesView.ts +16 -3
  105. package/front_end/panels/sources/UISourceCodeFrame.ts +7 -1
  106. package/front_end/panels/sources/watchExpressionsSidebarPane.css +2 -7
  107. package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -4
  108. package/front_end/panels/timeline/TimelineLayersView.ts +7 -7
  109. package/front_end/panels/timeline/TimelinePanel.ts +2 -1
  110. package/front_end/ui/legacy/SplitWidget.ts +6 -1
  111. package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +8 -1
  112. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +9 -1
  113. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +11 -1
  114. package/package.json +1 -1
@@ -7,21 +7,11 @@ import * as Host from '../../core/host/host.js';
7
7
  import * as UI from '../../ui/legacy/legacy.js';
8
8
 
9
9
  import {DeviceModeWrapper} from './DeviceModeWrapper.js';
10
+ import type {Bounds} from './InspectedPagePlaceholder.js';
10
11
  import {Events, InspectedPagePlaceholder} from './InspectedPagePlaceholder.js';
11
12
 
12
13
  let appInstance: AdvancedApp;
13
14
 
14
- interface Event {
15
- data: {
16
- to: UI.DockController.DockState,
17
- from: UI.DockController.DockState|undefined,
18
- x: number,
19
- y: number,
20
- width: number,
21
- height: number,
22
- };
23
- }
24
-
25
15
  export class AdvancedApp implements Common.App.App {
26
16
  private rootSplitWidget!: UI.SplitWidget.SplitWidget;
27
17
  private deviceModeView!: DeviceModeWrapper;
@@ -170,7 +160,7 @@ export class AdvancedApp implements Common.App.App {
170
160
  return UI.DockController.DockController.instance().dockSide() !== UI.DockController.DockState.UNDOCKED;
171
161
  }
172
162
 
173
- private onSetInspectedPageBounds(event: Event): void {
163
+ private onSetInspectedPageBounds(event: Common.EventTarget.EventTargetEvent<Bounds>): void {
174
164
  if (this.changingDockSide) {
175
165
  return;
176
166
  }
@@ -2,11 +2,13 @@
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 * as Common from '../../core/common/common.js';
5
6
  import * as UI from '../../ui/legacy/legacy.js';
6
7
 
7
8
  let inspectedPagePlaceholderInstance: InspectedPagePlaceholder;
8
9
 
9
- export class InspectedPagePlaceholder extends UI.Widget.Widget {
10
+ export class InspectedPagePlaceholder extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.Widget>(
11
+ UI.Widget.Widget) {
10
12
  private updateId?: number;
11
13
  constructor() {
12
14
  super(true);
@@ -81,3 +83,14 @@ export class InspectedPagePlaceholder extends UI.Widget.Widget {
81
83
  export const enum Events {
82
84
  Update = 'Update',
83
85
  }
86
+
87
+ export interface Bounds {
88
+ x: number;
89
+ y: number;
90
+ height: number;
91
+ width: number;
92
+ }
93
+
94
+ export type EventTypes = {
95
+ [Events.Update]: Bounds,
96
+ };
@@ -28,6 +28,7 @@
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';
31
32
  import * as i18n from '../../core/i18n/i18n.js';
32
33
  import * as Platform from '../../core/platform/platform.js';
33
34
  import * as SDK from '../../core/sdk/sdk.js';
@@ -155,7 +156,8 @@ const UIStrings = {
155
156
  const str_ = i18n.i18n.registerUIStrings('panels/layer_viewer/LayerDetailsView.ts', UIStrings);
156
157
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
157
158
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
158
- export class LayerDetailsView extends UI.Widget.Widget implements LayerView {
159
+ export class LayerDetailsView extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.Widget>(
160
+ UI.Widget.Widget) implements LayerView {
159
161
  private readonly layerViewHost: LayerViewHost;
160
162
  private readonly emptyWidget: UI.EmptyWidget.EmptyWidget;
161
163
  private layerSnapshotMap: Map<SDK.LayerTreeBase.Layer, SnapshotSelection>;
@@ -470,6 +472,10 @@ export enum Events {
470
472
  PaintProfilerRequested = 'PaintProfilerRequested',
471
473
  }
472
474
 
475
+ export type EventTypes = {
476
+ [Events.PaintProfilerRequested]: Selection,
477
+ };
478
+
473
479
  export const slowScrollRectNames = new Map([
474
480
  [SDK.LayerTreeBase.Layer.ScrollRectType.NonFastScrollable, i18nLazyString(UIStrings.nonFastScrollable)],
475
481
  [SDK.LayerTreeBase.Layer.ScrollRectType.TouchEventHandler, i18nLazyString(UIStrings.touchEventHandler)],
@@ -99,7 +99,8 @@ const uniformSamplerLocations = new Map<WebGLProgram, WebGLUniformLocation|null>
99
99
 
100
100
  const imageForTexture = new Map<WebGLTexture, HTMLImageElement>();
101
101
 
102
- export class Layers3DView extends UI.Widget.VBox implements LayerView {
102
+ export class Layers3DView extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox)
103
+ implements LayerView {
103
104
  private readonly failBanner: UI.Widget.VBox;
104
105
  private readonly layerViewHost: LayerViewHost;
105
106
  private transformController: TransformController;
@@ -892,6 +893,11 @@ export enum Events {
892
893
  ScaleChanged = 'ScaleChanged',
893
894
  }
894
895
 
896
+ export type EventTypes = {
897
+ [Events.PaintProfilerRequested]: Selection,
898
+ [Events.ScaleChanged]: void,
899
+ };
900
+
895
901
  export const enum ChromeTexture {
896
902
  Left = 0,
897
903
  Middle = 1,
@@ -28,6 +28,7 @@
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';
31
32
  import * as i18n from '../../core/i18n/i18n.js';
32
33
  import * as Platform from '../../core/platform/platform.js';
33
34
  import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';
@@ -75,7 +76,8 @@ let categories: {[x: string]: PaintProfilerCategory}|null = null;
75
76
 
76
77
  let logItemCategoriesMap: {[x: string]: PaintProfilerCategory}|null = null;
77
78
 
78
- export class PaintProfilerView extends UI.Widget.HBox {
79
+ export class PaintProfilerView extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.HBox>(
80
+ UI.Widget.HBox) {
79
81
  private canvasContainer: HTMLElement;
80
82
  private readonly progressBanner: HTMLElement;
81
83
  private pieChart: PerfUI.PieChart.PieChart;
@@ -422,6 +424,10 @@ export enum Events {
422
424
  WindowChanged = 'WindowChanged',
423
425
  }
424
426
 
427
+ export type EventTypes = {
428
+ [Events.WindowChanged]: void,
429
+ };
430
+
425
431
  export class PaintProfilerCommandLogView extends UI.ThrottledWidget.ThrottledWidget {
426
432
  private readonly treeOutline: UI.TreeOutline.TreeOutlineInShadow;
427
433
  private log: SDK.PaintProfiler.PaintProfilerLogItem[];
@@ -369,7 +369,8 @@ export class NetworkPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
369
369
  return this.throttlingSelect;
370
370
  }
371
371
 
372
- private onWindowChanged(event: Common.EventTarget.EventTargetEvent): void {
372
+ private onWindowChanged(event: Common.EventTarget.EventTargetEvent<PerfUI.TimelineOverviewPane.WindowChangedEvent>):
373
+ void {
373
374
  const startTime = Math.max(this.calculator.minimumBoundary(), event.data.startTime / 1000);
374
375
  const endTime = Math.min(this.calculator.maximumBoundary(), event.data.endTime / 1000);
375
376
  this.networkLogView.setWindow(startTime, endTime);
@@ -766,18 +767,18 @@ export class NetworkPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
766
767
  appendRevealItem.call(this, request);
767
768
  }
768
769
 
769
- private onFilmFrameSelected(event: Common.EventTarget.EventTargetEvent): void {
770
- const timestamp = (event.data as number);
770
+ private onFilmFrameSelected(event: Common.EventTarget.EventTargetEvent<number>): void {
771
+ const timestamp = event.data;
771
772
  this.overviewPane.setWindowTimes(0, timestamp);
772
773
  }
773
774
 
774
- private onFilmFrameEnter(event: Common.EventTarget.EventTargetEvent): void {
775
- const timestamp = (event.data as number);
775
+ private onFilmFrameEnter(event: Common.EventTarget.EventTargetEvent<number>): void {
776
+ const timestamp = event.data;
776
777
  this.networkOverview.selectFilmStripFrame(timestamp);
777
778
  this.networkLogView.selectFilmStripFrame(timestamp / 1000);
778
779
  }
779
780
 
780
- private onFilmFrameExit(_event: Common.EventTarget.EventTargetEvent): void {
781
+ private onFilmFrameExit(): void {
781
782
  this.networkOverview.clearFilmStripFrame();
782
783
  this.networkLogView.clearFilmStripFrame();
783
784
  }
@@ -190,9 +190,9 @@ export class CPUProfileFlameChart extends UI.Widget.VBox implements UI.Searchabl
190
190
  this.overviewPane.selectRange(timeLeft, timeRight);
191
191
  }
192
192
 
193
- onEntrySelected(event: Common.EventTarget.EventTargetEvent): void {
193
+ onEntrySelected(event: Common.EventTarget.EventTargetEvent<void|number>): void {
194
194
  if (event.data) {
195
- const eventIndex = Number(event.data);
195
+ const eventIndex = event.data;
196
196
  this.mainPane.setSelectedEntry(eventIndex);
197
197
  if (eventIndex === -1) {
198
198
  this.entrySelected = false;
@@ -205,7 +205,7 @@ export class CPUProfileFlameChart extends UI.Widget.VBox implements UI.Searchabl
205
205
  }
206
206
  }
207
207
 
208
- onEntryInvoked(event: Common.EventTarget.EventTargetEvent): void {
208
+ onEntryInvoked(event: Common.EventTarget.EventTargetEvent<number>): void {
209
209
  this.onEntrySelected(event);
210
210
  this.dispatchEventToListeners(PerfUI.FlameChart.Events.EntryInvoked, event.data);
211
211
  }
@@ -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 = (event.data as ProfileType);
285
+ onProfileTypeSelected(event: Common.EventTarget.EventTargetEvent<ProfileType>): void {
286
+ this.selectedProfileType = event.data;
287
287
  this.updateProfileTypeSpecificUI();
288
288
  }
289
289
 
@@ -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 = (event.data as Workspace.UISourceCode.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 = (event.data.wasSelected as boolean);
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
  }
@@ -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 = (event.data as Workspace.UISourceCode.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 = (event.data.uiSourceCode as Workspace.UISourceCode.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 = (event.data as Workspace.UISourceCode.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 implements TabbedEditorContainerDelegate, UI.SearchableView.Searchable,
44
- UI.SearchableView.Replaceable {
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
- this.dispatchEventToListeners(Events.EditorSelected, this.editorContainer.currentFile());
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
  */
@@ -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 SourceFrame.SourceFrame.SourceFrameImpl {
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: 6px;
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-2);
99
+ background-color: var(--color-background-elevation-1);
105
100
  }
106
101
 
107
102
  .watch-expression-header:focus-visible {
@@ -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 = (commonEvent.data as number);
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(event: Common.EventTarget.EventTargetEvent): void {
67
- const selection = (event.data as LayerViewer.LayerViewHost.Selection);
68
- this.layers3DView.snapshotForSelection(selection).then(snapshotWithRect => {
69
- if (snapshotWithRect) {
70
- this.showPaintProfilerCallback(snapshotWithRect.snapshot);
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(event: Common.EventTarget.EventTargetEvent): void {
451
+ private onOverviewWindowChanged(
452
+ event: Common.EventTarget.EventTargetEvent<PerfUI.TimelineOverviewPane.WindowChangedEvent>): void {
452
453
  if (!this.performanceModel) {
453
454
  return;
454
455
  }