chrome-devtools-frontend 1.0.1587572 → 1.0.1587905

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.
@@ -8,11 +8,8 @@ import * as Common from '../../core/common/common.js';
8
8
  import * as i18n from '../../core/i18n/i18n.js';
9
9
  import * as Platform from '../../core/platform/platform.js';
10
10
  import * as SDK from '../../core/sdk/sdk.js';
11
- import * as Annotations from '../../models/annotations/annotations.js';
12
11
  import type * as NetworkTimeCalculator from '../../models/network_time_calculator/network_time_calculator.js';
13
- import * as PanelCommon from '../../panels/common/common.js';
14
12
  import * as NetworkForward from '../../panels/network/forward/forward.js';
15
- import * as LegacyWrapper from '../../ui/components/legacy_wrapper/legacy_wrapper.js';
16
13
  import {Icon} from '../../ui/kit/kit.js';
17
14
  import type * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
18
15
  import * as UI from '../../ui/legacy/legacy.js';
@@ -22,7 +19,7 @@ import * as NetworkComponents from './components/components.js';
22
19
  import {EventSourceMessagesView} from './EventSourceMessagesView.js';
23
20
  import {RequestCookiesView} from './RequestCookiesView.js';
24
21
  import {RequestDeviceBoundSessionsView} from './RequestDeviceBoundSessionsView.js';
25
- import * as RequestHeadersView from './RequestHeadersView.js';
22
+ import {RequestHeadersView} from './RequestHeadersView.js';
26
23
  import {RequestInitiatorView} from './RequestInitiatorView.js';
27
24
  import {RequestPayloadView} from './RequestPayloadView.js';
28
25
  import {RequestPreviewView} from './RequestPreviewView.js';
@@ -149,7 +146,7 @@ const requestToPreviewView = new WeakMap<SDK.NetworkRequest.NetworkRequest, Requ
149
146
  export class NetworkItemView extends UI.TabbedPane.TabbedPane {
150
147
  #request: SDK.NetworkRequest.NetworkRequest;
151
148
  readonly #resourceViewTabSetting: Common.Settings.Setting<NetworkForward.UIRequestLocation.UIRequestTabs>;
152
- readonly #headersViewComponent: RequestHeadersView.RequestHeadersView|undefined;
149
+ readonly #headersViewComponent: RequestHeadersView|undefined;
153
150
  #payloadView: RequestPayloadView|null = null;
154
151
  readonly #responseView: RequestResponseView|undefined;
155
152
  #cookiesView: RequestCookiesView|null = null;
@@ -175,11 +172,11 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
175
172
  i18nString(UIStrings.headers));
176
173
  } else {
177
174
  this.#firstTab = NetworkForward.UIRequestLocation.UIRequestTabs.HEADERS_COMPONENT;
178
- this.#headersViewComponent = new RequestHeadersView.RequestHeadersView(request);
175
+ this.#headersViewComponent = new RequestHeadersView();
176
+ this.#headersViewComponent.request = request;
179
177
  this.appendTab(
180
178
  NetworkForward.UIRequestLocation.UIRequestTabs.HEADERS_COMPONENT, i18nString(UIStrings.headers),
181
- LegacyWrapper.LegacyWrapper.legacyWrapper(UI.Widget.VBox, this.#headersViewComponent),
182
- i18nString(UIStrings.headers));
179
+ this.#headersViewComponent, i18nString(UIStrings.headers));
183
180
  }
184
181
 
185
182
  this.#resourceViewTabSetting =
@@ -282,14 +279,6 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
282
279
  this.#initialTab = undefined;
283
280
  }
284
281
 
285
- if (Annotations.AnnotationRepository.annotationsEnabled()) {
286
- PanelCommon.AnnotationManager.instance().initializePlacementForAnnotationType(
287
- Annotations.AnnotationType.NETWORK_REQUEST_SUBPANEL_HEADERS, this.resolveInitialState.bind(this),
288
- this.element);
289
-
290
- void PanelCommon.AnnotationManager.instance().resolveAnnotationsOfType(
291
- Annotations.AnnotationType.NETWORK_REQUEST_SUBPANEL_HEADERS);
292
- }
293
282
  }
294
283
 
295
284
  override willHide(): void {
@@ -378,34 +367,6 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
378
367
  }
379
368
  }
380
369
 
381
- async resolveInitialState(
382
- parentElement: Element, reveal: boolean, lookupId: string,
383
- anchor?: SDK.DOMModel.DOMNode|SDK.NetworkRequest.NetworkRequest): Promise<{x: number, y: number}|null> {
384
- const request = anchor as SDK.NetworkRequest.NetworkRequest;
385
- if ((request && request !== this.request()) || (lookupId !== this.request().requestId())) {
386
- return null;
387
- }
388
-
389
- if (!this.#headersViewComponent) {
390
- return null;
391
- }
392
- await this.#headersViewComponent.render();
393
-
394
- const element = this.#headersViewComponent.getHeaderElementById('request-url');
395
- if (!element) {
396
- return null;
397
- }
398
-
399
- const targetRect = element.getBoundingClientRect();
400
- const parentRect = parentElement.getBoundingClientRect();
401
- // Adjust the anchor position slightly.
402
- const adjustX = 15;
403
- const adjustY = -19;
404
- const relativeX = targetRect.x - parentRect.x + adjustX;
405
- const relativeY = targetRect.y - parentRect.y + adjustY;
406
- return {x: relativeX, y: relativeY};
407
- }
408
-
409
370
  private tabSelected(event: Common.EventTarget.EventTargetEvent<UI.TabbedPane.EventData>): void {
410
371
  if (!event.data.isUserGesture) {
411
372
  return;
@@ -427,7 +388,7 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
427
388
  this.#headersViewComponent?.revealHeader(section, header);
428
389
  }
429
390
 
430
- getHeadersViewComponent(): RequestHeadersView.RequestHeadersView|undefined {
391
+ getHeadersViewComponent(): RequestHeadersView|undefined {
431
392
  return this.#headersViewComponent;
432
393
  }
433
394
  }