chrome-devtools-frontend 1.0.1672388 → 1.0.1674545
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/eslint.config.mjs +3 -3
- package/front_end/core/common/SettingRegistration.ts +1 -26
- package/front_end/core/common/Settings.ts +4 -53
- package/front_end/core/host/UserMetrics.ts +127 -117
- package/front_end/core/protocol_client/PuppeteerDevToolsConnection.ts +42 -9
- package/front_end/core/root/Runtime.ts +7 -2
- package/front_end/core/sdk/NetworkManager.ts +0 -35
- package/front_end/core/sdk/SourceMap.ts +1 -19
- package/front_end/core/sdk/SourceMapManager.ts +75 -48
- package/front_end/core/sdk/SourceMapScopesInfo.ts +0 -62
- package/front_end/devtools_compatibility.js +1 -1
- package/front_end/generated/InspectorBackendCommands.ts +4 -3
- package/front_end/generated/{SupportedCSSProperties.js → SupportedCSSProperties.ts} +32 -1
- package/front_end/generated/protocol-mapping.d.ts +8 -0
- package/front_end/generated/protocol-proxy-api.d.ts +6 -0
- package/front_end/generated/protocol.ts +16 -2
- package/front_end/models/ai_assistance/AiSetting.ts +66 -3
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +4 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +1 -1
- package/front_end/models/bindings/CompilerScriptMapping.ts +1 -1
- package/front_end/models/emulation/DeviceModeModel.ts +25 -34
- package/front_end/models/emulation/EmulatedDevices.ts +1 -1
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -4
- package/front_end/models/trace/ModelImpl.ts +5 -0
- package/front_end/models/trace/Processor.ts +47 -10
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +18 -19
- package/front_end/models/trace/handlers/MetaHandler.ts +46 -9
- package/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +11 -0
- package/front_end/models/trace/insights/CLSCulprits.ts +1 -2
- package/front_end/models/trace/insights/CharacterSet.ts +1 -1
- package/front_end/models/trace/insights/Common.ts +21 -2
- package/front_end/models/trace/insights/DocumentLatency.ts +1 -1
- package/front_end/models/trace/insights/LCPBreakdown.ts +7 -6
- package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
- package/front_end/models/trace/insights/ModernHTTP.ts +7 -3
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
- package/front_end/models/trace/insights/ThirdParties.ts +5 -2
- package/front_end/models/trace/insights/types.ts +11 -6
- package/front_end/models/trace/types/Configuration.ts +5 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +11 -10
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +3 -45
- package/front_end/panels/application/BackgroundServiceView.ts +42 -40
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
- package/front_end/panels/common/ExtensionServer.ts +7 -1
- package/front_end/panels/common/common.ts +0 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +7 -6
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/elements/ClassesPaneWidget.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +56 -5
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/components/AdornerManager.ts +1 -0
- package/front_end/panels/emulation/AdvancedApp.ts +3 -3
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -11
- package/front_end/panels/emulation/DeviceModeView.ts +234 -75
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +1 -1
- package/front_end/panels/emulation/deviceModeView.css +4 -21
- package/front_end/panels/emulation/emulation-meta.ts +4 -30
- package/front_end/panels/emulation/emulation.ts +0 -3
- package/front_end/panels/explain/components/ConsoleInsight.ts +11 -7
- package/front_end/panels/layers/LayersPanel.ts +2 -2
- package/front_end/panels/layers/layers-meta.ts +2 -2
- package/front_end/panels/lighthouse/LighthouseController.ts +3 -7
- package/front_end/panels/mobile_throttling/CPUThrottlingSelector.ts +313 -0
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +0 -10
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +23 -10
- package/front_end/panels/mobile_throttling/mobile_throttling.ts +3 -0
- package/front_end/panels/network/NetworkConfigView.ts +1 -71
- package/front_end/panels/network/networkConfigView.css +1 -2
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +3 -3
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +5 -5
- package/front_end/panels/profiler/HeapProfileView.ts +32 -32
- package/front_end/panels/profiler/HeapProfilerPanel.ts +2 -2
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +33 -37
- package/front_end/panels/profiler/HeapSnapshotGridNodes.ts +26 -27
- package/front_end/panels/profiler/HeapSnapshotView.ts +48 -48
- package/front_end/panels/profiler/IsolateSelector.ts +10 -10
- package/front_end/panels/profiler/ModuleUIStrings.ts +25 -25
- package/front_end/panels/profiler/ProfileLauncherView.ts +6 -6
- package/front_end/panels/profiler/ProfilesPanel.ts +6 -6
- package/front_end/panels/profiler/WritableProfileHeader.ts +6 -6
- package/front_end/panels/profiler/profiler-meta.ts +7 -7
- package/front_end/panels/recorder/RecorderPanel.ts +1 -1
- package/front_end/panels/settings/AISettingsTab.ts +27 -23
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +463 -13
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +12 -17
- package/front_end/panels/timeline/TimelinePanel.ts +22 -35
- package/front_end/panels/timeline/components/CWVMetrics.ts +16 -3
- package/front_end/panels/timeline/components/LiveMetricsView.ts +27 -6
- package/front_end/panels/timeline/components/NetworkTrackWidget.ts +1 -1
- package/front_end/panels/timeline/components/components.ts +0 -4
- package/front_end/panels/timeline/components/cwvMetrics.css +4 -0
- package/front_end/panels/timeline/components/liveMetricsView.css +7 -17
- package/front_end/panels/timeline/components/metricValueStyles.css +17 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +64 -15
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +65 -16
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +50 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +8 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +16 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js +11 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.js +5 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +4 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts +27 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js +12 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +5 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +64 -15
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +50 -7
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +9 -7
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +9 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Dialog.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +24 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +11 -6
- package/front_end/third_party/puppeteer/package/src/cdp/Dialog.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +11 -0
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/common/Debug.ts +30 -5
- package/front_end/third_party/puppeteer/package/src/common/util.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +2 -0
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +6 -4
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/CONTRIBUTING.md +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/LICENSE +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/README.md +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/deno.json +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js +2 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js.map +1 -1
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +2 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/codec.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/mod.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/scopes.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/util.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/util.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/util.ts +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/vlq.js +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/vlq.js.map +0 -0
- package/front_end/third_party/source-map-scopes-codec/package/src/vlq.ts +0 -0
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +2 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +4 -12
- package/front_end/ui/components/settings/settingCheckbox.css +0 -7
- package/front_end/ui/legacy/Treeoutline.ts +14 -14
- package/front_end/ui/legacy/UIUtils.ts +2 -47
- package/front_end/ui/legacy/Widget.ts +10 -2
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +1 -1
- package/front_end/ui/lit/Directives.ts +80 -0
- package/front_end/ui/lit/lit.ts +1 -0
- package/front_end/ui/lit/render.ts +8 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +18 -0
- package/mcp/mcp.ts +1 -0
- package/package.json +1 -1
- package/front_end/panels/common/ThrottlingUtils.ts +0 -51
- package/front_end/panels/emulation/DeviceModeWrapper.ts +0 -248
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +0 -235
- package/front_end/panels/timeline/components/NetworkThrottlingSelector.ts +0 -245
- package/front_end/panels/timeline/components/cpuThrottlingSelector.css +0 -30
- package/front_end/panels/timeline/components/networkThrottlingSelector.css +0 -24
- /package/front_end/core/host/{UserMetricsEnums.d.ts → UserMetricsEnums.ts} +0 -0
- /package/front_end/generated/{ARIAProperties.js → ARIAProperties.ts} +0 -0
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
// Copyright 2016 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import type * as Common from '../../core/common/common.js';
|
|
6
|
-
import * as Root from '../../core/root/root.js';
|
|
7
|
-
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
-
import type * as Protocol from '../../generated/protocol.js';
|
|
9
|
-
import * as EmulationModel from '../../models/emulation/emulation.js';
|
|
10
|
-
import * as Geometry from '../../models/geometry/geometry.js';
|
|
11
|
-
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
|
-
import {html, render} from '../../ui/lit/lit.js';
|
|
13
|
-
|
|
14
|
-
import {DeviceModeView} from './DeviceModeView.js';
|
|
15
|
-
import {InspectedPagePlaceholder} from './InspectedPagePlaceholder.js';
|
|
16
|
-
|
|
17
|
-
const {widget} = UI.Widget;
|
|
18
|
-
interface ViewInput {
|
|
19
|
-
showDeviceMode: boolean;
|
|
20
|
-
}
|
|
21
|
-
type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
22
|
-
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
23
|
-
// clang-format off
|
|
24
|
-
render(input.showDeviceMode ?
|
|
25
|
-
html`<devtools-widget ${widget(DeviceModeView)}>
|
|
26
|
-
${widget(() => InspectedPagePlaceholder.instance(), {minimumSize: new Geometry.Size(1, 1)})}
|
|
27
|
-
</devtools-widget>` :
|
|
28
|
-
widget(() => InspectedPagePlaceholder.instance(), {minimumSize: new Geometry.Size(150, 150)}),
|
|
29
|
-
target);
|
|
30
|
-
// clang-format on
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export class DeviceModeWrapper extends UI.Widget.VBox {
|
|
34
|
-
private readonly toggleDeviceModeAction: UI.ActionRegistration.Action;
|
|
35
|
-
private showDeviceModeSetting: Common.Settings.Setting<boolean>;
|
|
36
|
-
readonly #view: View;
|
|
37
|
-
|
|
38
|
-
constructor(element?: HTMLElement, view = DEFAULT_VIEW) {
|
|
39
|
-
super(element);
|
|
40
|
-
this.#view = view;
|
|
41
|
-
this.toggleDeviceModeAction = UI.ActionRegistry.ActionRegistry.instance().getAction('emulation.toggle-device-mode');
|
|
42
|
-
const model = EmulationModel.DeviceModeModel.DeviceModeModel.instance();
|
|
43
|
-
this.showDeviceModeSetting = model.enabledSetting();
|
|
44
|
-
this.showDeviceModeSetting.setRequiresUserAction(Boolean(Root.Runtime.Runtime.queryParam('hasOtherClients')));
|
|
45
|
-
this.showDeviceModeSetting.addChangeListener(this.requestUpdate.bind(this));
|
|
46
|
-
SDK.TargetManager.TargetManager.instance().addModelListener(SDK.OverlayModel.OverlayModel,
|
|
47
|
-
SDK.OverlayModel.Events.SCREENSHOT_REQUESTED,
|
|
48
|
-
this.screenshotRequestedFromOverlay, this);
|
|
49
|
-
this.requestUpdate();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
static #setNonEmulatedAvailableSize(): void {
|
|
53
|
-
const model = EmulationModel.DeviceModeModel.DeviceModeModel.instance();
|
|
54
|
-
if (model.type() !== EmulationModel.DeviceModeModel.Type.None) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const zoomFactor = UI.ZoomManager.ZoomManager.instance().zoomFactor();
|
|
59
|
-
const rect = InspectedPagePlaceholder.instance().element.getBoundingClientRect();
|
|
60
|
-
const availableSize =
|
|
61
|
-
new Geometry.Size(Math.max(rect.width * zoomFactor, 1), Math.max(rect.height * zoomFactor, 1));
|
|
62
|
-
model.setAvailableSize(availableSize, availableSize);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
static captureScreenshot(fullSize?: boolean, clip?: Protocol.Page.Viewport): boolean {
|
|
66
|
-
const model = EmulationModel.DeviceModeModel.DeviceModeModel.instance();
|
|
67
|
-
|
|
68
|
-
this.#setNonEmulatedAvailableSize();
|
|
69
|
-
if (fullSize) {
|
|
70
|
-
void model.captureFullSizeScreenshot();
|
|
71
|
-
} else if (clip) {
|
|
72
|
-
void model.captureAreaScreenshot(clip);
|
|
73
|
-
} else {
|
|
74
|
-
void model.captureScreenshot();
|
|
75
|
-
}
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
private screenshotRequestedFromOverlay(event: Common.EventTarget.EventTargetEvent<Protocol.Page.Viewport>): void {
|
|
80
|
-
const clip = event.data;
|
|
81
|
-
DeviceModeWrapper.captureScreenshot(false, clip);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
override performUpdate(): void {
|
|
85
|
-
this.toggleDeviceModeAction.setToggled(this.showDeviceModeSetting.get());
|
|
86
|
-
|
|
87
|
-
this.#view({showDeviceMode: this.showDeviceModeSetting.get()}, undefined, this.contentElement);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
92
|
-
handleAction(context: UI.Context.Context, actionId: string): boolean {
|
|
93
|
-
switch (actionId) {
|
|
94
|
-
case 'emulation.capture-screenshot':
|
|
95
|
-
return DeviceModeWrapper.captureScreenshot();
|
|
96
|
-
|
|
97
|
-
case 'emulation.capture-node-screenshot': {
|
|
98
|
-
const node = context.flavor(SDK.DOMModel.DOMNode);
|
|
99
|
-
if (!node) {
|
|
100
|
-
return true;
|
|
101
|
-
}
|
|
102
|
-
async function captureClip(): Promise<void> {
|
|
103
|
-
if (!node) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Resolve to a remote object to ensure the node is alive in the context.
|
|
108
|
-
const object = await node.resolveToObject();
|
|
109
|
-
if (!object) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Get the Box Model via CDP.
|
|
114
|
-
// This returns the quads relative to the target's viewport.
|
|
115
|
-
// We use the 'border' quad to include the border and padding in the screenshot,
|
|
116
|
-
// matching the 'width' and 'height' properties which are also Border Box dimensions.
|
|
117
|
-
const nodeBoxModel = await node.boxModel();
|
|
118
|
-
if (!nodeBoxModel) {
|
|
119
|
-
throw new Error(`Unable to get box model of the node: ${new Error().stack}`);
|
|
120
|
-
}
|
|
121
|
-
const nodeBorderQuad = nodeBoxModel.border;
|
|
122
|
-
// Calculate the rendered bounding box from the border quad to account for CSS scaling and transforms (e.g. zoom or transform: scale).
|
|
123
|
-
const {minX, maxX, minY, maxY} = getQuadBoundingBox(nodeBorderQuad);
|
|
124
|
-
|
|
125
|
-
// Get Layout Metrics to account for the Visual Viewport scroll and zoom.
|
|
126
|
-
const metrics = await node.domModel().target().pageAgent().invoke_getLayoutMetrics();
|
|
127
|
-
if (metrics.getError()) {
|
|
128
|
-
throw new Error(`Unable to get metrics: ${new Error().stack}`);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const scrollX = metrics.cssVisualViewport.pageX;
|
|
132
|
-
const scrollY = metrics.cssVisualViewport.pageY;
|
|
133
|
-
|
|
134
|
-
// Calculate the global offset for OOPiFs (Out-of-Process iframes).
|
|
135
|
-
// This accounts for the position of the target's frame within the main page.
|
|
136
|
-
const {x: oopifOffsetX, y: oopifOffsetY} = await getOopifOffset(node.domModel().target());
|
|
137
|
-
|
|
138
|
-
// Assemble the final Clip.
|
|
139
|
-
// The absolute coordinates are: Global (OOPiF) + Viewport Scroll + Local Node Position (Border Box).
|
|
140
|
-
const clip = {
|
|
141
|
-
x: oopifOffsetX + scrollX + minX,
|
|
142
|
-
y: oopifOffsetY + scrollY + minY,
|
|
143
|
-
width: maxX - minX,
|
|
144
|
-
height: maxY - minY,
|
|
145
|
-
scale: 1,
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
// Apply Zoom factor.
|
|
149
|
-
const zoom = metrics.cssVisualViewport.zoom ?? 1;
|
|
150
|
-
clip.x *= zoom;
|
|
151
|
-
clip.y *= zoom;
|
|
152
|
-
clip.width *= zoom;
|
|
153
|
-
clip.height *= zoom;
|
|
154
|
-
DeviceModeWrapper.captureScreenshot(false, clip);
|
|
155
|
-
}
|
|
156
|
-
void captureClip();
|
|
157
|
-
return true;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
case 'emulation.capture-full-height-screenshot':
|
|
161
|
-
return DeviceModeWrapper.captureScreenshot(true);
|
|
162
|
-
|
|
163
|
-
case 'emulation.toggle-device-mode': {
|
|
164
|
-
const model = EmulationModel.DeviceModeModel.DeviceModeModel.instance();
|
|
165
|
-
model.toggleDeviceMode();
|
|
166
|
-
return true;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Calculate the offset of the "Local Root" frame relative to the "Global Root" (the main frame).
|
|
175
|
-
* This involves traversing the CDP Targets for OOPiFs.
|
|
176
|
-
*/
|
|
177
|
-
async function getOopifOffset(target: SDK.Target.Target|null): Promise<{x: number, y: number}> {
|
|
178
|
-
if (!target) {
|
|
179
|
-
return {x: 0, y: 0};
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Get the parent target. If there's no parent (we are at root) or it's not a frame, we are done.
|
|
183
|
-
const parentTarget = target.parentTarget();
|
|
184
|
-
if (!parentTarget || parentTarget.type() !== SDK.Target.Type.FRAME) {
|
|
185
|
-
return {x: 0, y: 0};
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// Identify the current frame's ID to find its owner in the parent.
|
|
189
|
-
const frameId = target.model(SDK.ResourceTreeModel.ResourceTreeModel)?.mainFrame?.id;
|
|
190
|
-
if (!frameId) {
|
|
191
|
-
return {x: 0, y: 0};
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Get the DOMModel of the parent to query the frame owner element.
|
|
195
|
-
const parentDOMModel = parentTarget.model(SDK.DOMModel.DOMModel);
|
|
196
|
-
if (!parentDOMModel) {
|
|
197
|
-
return {x: 0, y: 0};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// Retrieve the frame owner node (e.g. the <iframe> element) in the parent's document.
|
|
201
|
-
const frameOwnerDeferred = await parentDOMModel.getOwnerNodeForFrame(frameId);
|
|
202
|
-
const frameOwner = await frameOwnerDeferred?.resolvePromise();
|
|
203
|
-
if (!frameOwner) {
|
|
204
|
-
return {x: 0, y: 0};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Get the content box of the iframe element.
|
|
208
|
-
// This is relative to the parent target's viewport.
|
|
209
|
-
const boxModel = await frameOwner.boxModel();
|
|
210
|
-
if (!boxModel) {
|
|
211
|
-
return {x: 0, y: 0};
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// content is a Quad [x1, y1, x2, y2, x3, y3, x4, y4]
|
|
215
|
-
const contentQuad = boxModel.content;
|
|
216
|
-
const iframeContentX = contentQuad[0];
|
|
217
|
-
const iframeContentY = contentQuad[1];
|
|
218
|
-
|
|
219
|
-
// Get the scroll position of the parent target to convert viewport-relative coordinates
|
|
220
|
-
// to document-relative coordinates.
|
|
221
|
-
const parentMetrics = await parentTarget.pageAgent().invoke_getLayoutMetrics();
|
|
222
|
-
if (parentMetrics.getError()) {
|
|
223
|
-
return {x: 0, y: 0};
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
const scrollX = parentMetrics.cssVisualViewport.pageX;
|
|
227
|
-
const scrollY = parentMetrics.cssVisualViewport.pageY;
|
|
228
|
-
|
|
229
|
-
// Recursively add the offset of the parent target itself (if it is also an OOPiF).
|
|
230
|
-
const parentOffset = await getOopifOffset(parentTarget);
|
|
231
|
-
|
|
232
|
-
return {
|
|
233
|
-
x: iframeContentX + scrollX + parentOffset.x,
|
|
234
|
-
y: iframeContentY + scrollY + parentOffset.y,
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* Calculate the axis-aligned bounding box for a Quad [x1, y1, x2, y2, x3, y3, x4, y4].
|
|
240
|
-
* This accounts for CSS scaling and transforms (e.g. zoom, transform: scale).
|
|
241
|
-
*/
|
|
242
|
-
function getQuadBoundingBox(quad: Protocol.DOM.Quad): {minX: number, maxX: number, minY: number, maxY: number} {
|
|
243
|
-
const minX = Math.min(quad[0], quad[2], quad[4], quad[6]);
|
|
244
|
-
const maxX = Math.max(quad[0], quad[2], quad[4], quad[6]);
|
|
245
|
-
const minY = Math.min(quad[1], quad[3], quad[5], quad[7]);
|
|
246
|
-
const maxY = Math.max(quad[1], quad[3], quad[5], quad[7]);
|
|
247
|
-
return {minX, maxX, minY, maxY};
|
|
248
|
-
}
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import '../../../ui/kit/kit.js';
|
|
6
|
-
import '../../../ui/components/menus/menus.js';
|
|
7
|
-
|
|
8
|
-
import * as Common from '../../../core/common/common.js';
|
|
9
|
-
import * as i18n from '../../../core/i18n/i18n.js';
|
|
10
|
-
import * as SDK from '../../../core/sdk/sdk.js';
|
|
11
|
-
import type * as Menus from '../../../ui/components/menus/menus.js';
|
|
12
|
-
import * as UI from '../../../ui/legacy/legacy.js';
|
|
13
|
-
import * as Lit from '../../../ui/lit/lit.js';
|
|
14
|
-
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
|
|
15
|
-
import * as PanelsCommon from '../../common/common.js';
|
|
16
|
-
import * as MobileThrottling from '../../mobile_throttling/mobile_throttling.js';
|
|
17
|
-
|
|
18
|
-
import cpuThrottlingSelectorStyles from './cpuThrottlingSelector.css.js';
|
|
19
|
-
|
|
20
|
-
const {render, html} = Lit;
|
|
21
|
-
|
|
22
|
-
const UIStrings = {
|
|
23
|
-
/**
|
|
24
|
-
* @description Text label for a selection box showing which CPU throttling option is applied.
|
|
25
|
-
* @example {No throttling} PH1
|
|
26
|
-
*/
|
|
27
|
-
cpu: 'CPU: {PH1}',
|
|
28
|
-
/**
|
|
29
|
-
* @description Text label for a selection box showing which CPU throttling option is applied.
|
|
30
|
-
* @example {No throttling} PH1
|
|
31
|
-
*/
|
|
32
|
-
cpuThrottling: 'CPU throttling: {PH1}',
|
|
33
|
-
/**
|
|
34
|
-
* @description Text label for a selection box showing that a specific option is recommended.
|
|
35
|
-
* @example {4x slowdown} PH1
|
|
36
|
-
*/
|
|
37
|
-
recommendedThrottling: '{PH1} – recommended',
|
|
38
|
-
/**
|
|
39
|
-
* @description Text for why user should change a throttling setting.
|
|
40
|
-
*/
|
|
41
|
-
recommendedThrottlingReason: 'Consider changing setting to simulate real user environments',
|
|
42
|
-
/**
|
|
43
|
-
* @description Text to prompt the user to run the CPU calibration process.
|
|
44
|
-
*/
|
|
45
|
-
calibrate: 'Calibrate…',
|
|
46
|
-
/**
|
|
47
|
-
* @description Text to prompt the user to re-run the CPU calibration process.
|
|
48
|
-
*/
|
|
49
|
-
recalibrate: 'Recalibrate…',
|
|
50
|
-
/**
|
|
51
|
-
* @description Label shown above a list of CPU calibration preset options.
|
|
52
|
-
*/
|
|
53
|
-
labelCalibratedPresets: 'Calibrated presets',
|
|
54
|
-
} as const;
|
|
55
|
-
|
|
56
|
-
const str_ = i18n.i18n.registerUIStrings('panels/timeline/components/CPUThrottlingSelector.ts', UIStrings);
|
|
57
|
-
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
58
|
-
|
|
59
|
-
interface CPUThrottlingGroup {
|
|
60
|
-
name: string;
|
|
61
|
-
items: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption[];
|
|
62
|
-
showCustomAddOption?: boolean;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
interface ViewInput {
|
|
66
|
-
recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null;
|
|
67
|
-
currentOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption;
|
|
68
|
-
groups: CPUThrottlingGroup[];
|
|
69
|
-
throttling: PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling;
|
|
70
|
-
onMenuItemSelected: (event: Menus.SelectMenu.SelectMenuItemSelectedEvent) => void;
|
|
71
|
-
onCalibrateClick: () => void;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLElement): void => {
|
|
75
|
-
let recommendedInfoEl;
|
|
76
|
-
if (input.recommendedOption && input.currentOption === PanelsCommon.CPUThrottlingOption.NoThrottlingOption) {
|
|
77
|
-
recommendedInfoEl = html`<devtools-icon
|
|
78
|
-
title=${i18nString(UIStrings.recommendedThrottlingReason)}
|
|
79
|
-
name=info></devtools-icon>`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const selectionTitle = input.currentOption.title();
|
|
83
|
-
const hasCalibratedOnce = input.throttling.low || input.throttling.mid;
|
|
84
|
-
const calibrationLabel = hasCalibratedOnce ? i18nString(UIStrings.recalibrate) : i18nString(UIStrings.calibrate);
|
|
85
|
-
|
|
86
|
-
// clang-format off
|
|
87
|
-
/* eslint-disable @devtools/no-deprecated-component-usages */
|
|
88
|
-
const template = html`
|
|
89
|
-
<style>${cpuThrottlingSelectorStyles}</style>
|
|
90
|
-
<devtools-select-menu
|
|
91
|
-
@selectmenuselected=${input.onMenuItemSelected}
|
|
92
|
-
.showDivider=${true}
|
|
93
|
-
.showArrow=${true}
|
|
94
|
-
.sideButton=${false}
|
|
95
|
-
.showSelectedItem=${true}
|
|
96
|
-
.jslogContext=${'cpu-throttling'}
|
|
97
|
-
.buttonTitle=${i18nString(UIStrings.cpu, {PH1: selectionTitle})}
|
|
98
|
-
.title=${i18nString(UIStrings.cpuThrottling, {PH1: selectionTitle})}
|
|
99
|
-
>
|
|
100
|
-
${input.groups.map(group => {
|
|
101
|
-
return html`
|
|
102
|
-
<devtools-menu-group .name=${group.name} .title=${group.name}>
|
|
103
|
-
${group.items.map(option => {
|
|
104
|
-
const title = option === input.recommendedOption ? i18nString(UIStrings.recommendedThrottling, {PH1: option.title()}) : option.title();
|
|
105
|
-
const rate = option.rate();
|
|
106
|
-
return html`
|
|
107
|
-
<devtools-menu-item
|
|
108
|
-
.value=${option.calibratedDeviceType ?? rate}
|
|
109
|
-
.selected=${input.currentOption === option}
|
|
110
|
-
.disabled=${rate === 0}
|
|
111
|
-
.title=${title}
|
|
112
|
-
jslog=${VisualLogging.item(option.jslogContext).track({click: true})}
|
|
113
|
-
>
|
|
114
|
-
${title}
|
|
115
|
-
</devtools-menu-item>
|
|
116
|
-
`;
|
|
117
|
-
})}
|
|
118
|
-
${group.name === 'Calibrated presets' ? html`<devtools-menu-item
|
|
119
|
-
.value=${-1 /* This won't be displayed unless it has some value. */}
|
|
120
|
-
.title=${calibrationLabel}
|
|
121
|
-
jslog=${VisualLogging.action('cpu-throttling-selector-calibrate').track({click: true})}
|
|
122
|
-
@click=${input.onCalibrateClick}
|
|
123
|
-
>
|
|
124
|
-
${calibrationLabel}
|
|
125
|
-
</devtools-menu-item>` : Lit.nothing}
|
|
126
|
-
</devtools-menu-group>`;
|
|
127
|
-
})}
|
|
128
|
-
</devtools-select-menu>
|
|
129
|
-
${recommendedInfoEl}
|
|
130
|
-
`;
|
|
131
|
-
// clang-format on
|
|
132
|
-
render(template, target);
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
type View = typeof DEFAULT_VIEW;
|
|
136
|
-
|
|
137
|
-
export class CPUThrottlingSelector extends UI.Widget.Widget {
|
|
138
|
-
#currentOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption;
|
|
139
|
-
#recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null = null;
|
|
140
|
-
#groups: CPUThrottlingGroup[] = [];
|
|
141
|
-
#calibratedThrottlingSetting: Common.Settings.Setting<PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling>;
|
|
142
|
-
readonly #view: View;
|
|
143
|
-
readonly #cpuThrottlingManager = SDK.CPUThrottlingManager.CPUThrottlingManager.instance();
|
|
144
|
-
|
|
145
|
-
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
146
|
-
super(element);
|
|
147
|
-
this.#currentOption = MobileThrottling.ThrottlingManager.throttlingManager().cpuThrottlingOption();
|
|
148
|
-
this.#calibratedThrottlingSetting =
|
|
149
|
-
Common.Settings.Settings.instance().createSetting<PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling>(
|
|
150
|
-
'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
|
|
151
|
-
this.#resetGroups();
|
|
152
|
-
this.#view = view;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
set recommendedOption(recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null) {
|
|
156
|
-
this.#recommendedOption = recommendedOption;
|
|
157
|
-
this.requestUpdate();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
override wasShown(): void {
|
|
161
|
-
super.wasShown();
|
|
162
|
-
this.#cpuThrottlingManager.addEventListener(SDK.CPUThrottlingManager.Events.RATE_CHANGED, this.#onOptionChange,
|
|
163
|
-
this);
|
|
164
|
-
this.#calibratedThrottlingSetting.addChangeListener(this.#onCalibratedSettingChanged, this);
|
|
165
|
-
this.#onOptionChange();
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
override willHide(): void {
|
|
169
|
-
super.willHide();
|
|
170
|
-
this.#calibratedThrottlingSetting.removeChangeListener(this.#onCalibratedSettingChanged, this);
|
|
171
|
-
this.#cpuThrottlingManager.removeEventListener(SDK.CPUThrottlingManager.Events.RATE_CHANGED, this.#onOptionChange,
|
|
172
|
-
this);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
#onOptionChange(): void {
|
|
176
|
-
this.#currentOption = MobileThrottling.ThrottlingManager.throttlingManager().cpuThrottlingOption();
|
|
177
|
-
|
|
178
|
-
this.requestUpdate();
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
#onCalibratedSettingChanged(): void {
|
|
182
|
-
this.#resetGroups();
|
|
183
|
-
this.requestUpdate();
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
#onMenuItemSelected(event: Menus.SelectMenu.SelectMenuItemSelectedEvent): void {
|
|
187
|
-
let option;
|
|
188
|
-
if (typeof event.itemValue === 'string') {
|
|
189
|
-
if (event.itemValue === 'low-tier-mobile') {
|
|
190
|
-
option = PanelsCommon.CPUThrottlingOption.CalibratedLowTierMobileThrottlingOption;
|
|
191
|
-
} else if (event.itemValue === 'mid-tier-mobile') {
|
|
192
|
-
option = PanelsCommon.CPUThrottlingOption.CalibratedMidTierMobileThrottlingOption;
|
|
193
|
-
}
|
|
194
|
-
} else {
|
|
195
|
-
const rate = Number(event.itemValue);
|
|
196
|
-
option = MobileThrottling.ThrottlingPresets.ThrottlingPresets.cpuThrottlingPresets.find(
|
|
197
|
-
option => !option.calibratedDeviceType && option.rate() === rate);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (option) {
|
|
201
|
-
MobileThrottling.ThrottlingManager.throttlingManager().setCPUThrottlingOption(option);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
#onCalibrateClick(): void {
|
|
206
|
-
void Common.Revealer.reveal(this.#calibratedThrottlingSetting);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
#resetGroups(): void {
|
|
210
|
-
this.#groups = [
|
|
211
|
-
{
|
|
212
|
-
name: '',
|
|
213
|
-
items: MobileThrottling.ThrottlingPresets.ThrottlingPresets.cpuThrottlingPresets.filter(
|
|
214
|
-
option => !option.calibratedDeviceType),
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
name: i18nString(UIStrings.labelCalibratedPresets),
|
|
218
|
-
items: MobileThrottling.ThrottlingPresets.ThrottlingPresets.cpuThrottlingPresets.filter(
|
|
219
|
-
option => option.calibratedDeviceType),
|
|
220
|
-
},
|
|
221
|
-
];
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
override async performUpdate(): Promise<void> {
|
|
225
|
-
const input: ViewInput = {
|
|
226
|
-
recommendedOption: this.#recommendedOption,
|
|
227
|
-
currentOption: this.#currentOption,
|
|
228
|
-
groups: this.#groups,
|
|
229
|
-
throttling: this.#calibratedThrottlingSetting.get(),
|
|
230
|
-
onMenuItemSelected: this.#onMenuItemSelected.bind(this),
|
|
231
|
-
onCalibrateClick: this.#onCalibrateClick.bind(this),
|
|
232
|
-
};
|
|
233
|
-
this.#view(input, undefined, this.contentElement);
|
|
234
|
-
}
|
|
235
|
-
}
|