helium/devtools: remove "account" section from settings (#405)

Fixes #400
This commit is contained in:
jj
2025-11-06 18:10:15 +01:00
committed by GitHub
parent 48577b920b
commit 7815dd5522

View File

@@ -33,3 +33,111 @@
}
}
--- a/third_party/devtools-frontend/src/front_end/panels/settings/BUILD.gn
+++ b/third_party/devtools-frontend/src/front_end/panels/settings/BUILD.gn
@@ -51,7 +51,6 @@ devtools_module("settings") {
"../../ui/legacy/components/utils:bundle",
"../../ui/lit:bundle",
"../utils:bundle",
- "./components:bundle",
]
}
--- a/third_party/devtools-frontend/src/front_end/panels/settings/SettingsScreen.ts
+++ b/third_party/devtools-frontend/src/front_end/panels/settings/SettingsScreen.ts
@@ -220,11 +220,8 @@ interface SettingsTab {
}
export class GenericSettingsTab extends UI.Widget.VBox implements SettingsTab {
- private readonly syncSection = new PanelComponents.SyncSection.SyncSection();
private readonly settingToControl = new Map<Common.Settings.Setting<unknown>, HTMLElement>();
private readonly containerElement: HTMLElement;
- #updateSyncSectionTimerId = -1;
- #syncSectionUpdatePromise: Promise<void>|null = null;
constructor() {
super({jslog: `${VisualLogging.pane('preferences')}`});
@@ -293,39 +290,13 @@ export class GenericSettingsTab extends
override wasShown(): void {
UI.Context.Context.instance().setFlavor(GenericSettingsTab, this);
super.wasShown();
- this.updateSyncSection();
}
override willHide(): void {
- if (this.#updateSyncSectionTimerId > 0) {
- window.clearTimeout(this.#updateSyncSectionTimerId);
- this.#updateSyncSectionTimerId = -1;
- }
super.willHide();
UI.Context.Context.instance().setFlavor(GenericSettingsTab, null);
}
- private updateSyncSection(): void {
- if (this.#updateSyncSectionTimerId > 0) {
- window.clearTimeout(this.#updateSyncSectionTimerId);
- this.#updateSyncSectionTimerId = -1;
- }
-
- this.#syncSectionUpdatePromise =
- new Promise<Host.InspectorFrontendHostAPI.SyncInformation>(
- resolve => Host.InspectorFrontendHost.InspectorFrontendHostInstance.getSyncInformation(resolve))
- .then(syncInfo => {
- this.syncSection.data = {
- syncInfo,
- syncSetting: Common.Settings.moduleSetting('sync-preferences') as Common.Settings.Setting<boolean>,
- receiveBadgesSetting: Common.Settings.Settings.instance().moduleSetting('receive-gdp-badges'),
- };
- if (!syncInfo.isSyncActive || !syncInfo.arePreferencesSynced) {
- this.#updateSyncSectionTimerId = window.setTimeout(this.updateSyncSection.bind(this), 500);
- }
- });
- }
-
private createExtensionSection(settings: Common.Settings.SettingRegistration[]): void {
const sectionName = Common.Settings.SettingCategory.EXTENSIONS;
const settingUI = Components.Linkifier.LinkHandlerSettingUI.instance() as UI.SettingsUI.SettingUI;
@@ -340,12 +311,7 @@ export class GenericSettingsTab extends
// Always create the EXTENSIONS section and append the link handling control.
if (category === Common.Settings.SettingCategory.EXTENSIONS) {
this.createExtensionSection(settings);
- } else if (category === Common.Settings.SettingCategory.ACCOUNT && settings.length > 0) {
- const syncCard = createSettingsCard(
- Common.SettingRegistration.getLocalizedSettingsCategory(Common.SettingRegistration.SettingCategory.ACCOUNT),
- this.syncSection);
- this.containerElement.appendChild(syncCard);
- } else if (settings.length > 0) {
+ } else if (category !== Common.Settings.SettingCategory.ACCOUNT && settings.length > 0) {
this.createStandardSectionElement(category, settings);
}
}
@@ -375,10 +341,6 @@ export class GenericSettingsTab extends
const element = this.settingToControl.get(setting);
if (element) {
PanelUtils.highlightElement(element);
- } else if (setting.name === 'receive-gdp-badges') {
- void this.#syncSectionUpdatePromise?.then(() => {
- void this.syncSection.highlightReceiveBadgesSetting();
- });
}
}
}
--- a/third_party/devtools-frontend/src/config/gni/devtools_grd_files.gni
+++ b/third_party/devtools-frontend/src/config/gni/devtools_grd_files.gni
@@ -707,7 +707,6 @@ grd_files_bundled_sources = [
"front_end/panels/security/security.js",
"front_end/panels/sensors/sensors-meta.js",
"front_end/panels/sensors/sensors.js",
- "front_end/panels/settings/components/components.js",
"front_end/panels/settings/emulation/components/components.js",
"front_end/panels/settings/emulation/emulation-meta.js",
"front_end/panels/settings/emulation/emulation.js",
@@ -1867,8 +1866,6 @@ grd_files_unbundled_sources = [
"front_end/panels/settings/SettingsScreen.js",
"front_end/panels/settings/WorkspaceSettingsTab.js",
"front_end/panels/settings/aiSettingsTab.css.js",
- "front_end/panels/settings/components/SyncSection.js",
- "front_end/panels/settings/components/syncSection.css.js",
"front_end/panels/settings/emulation/DevicesSettingsTab.js",
"front_end/panels/settings/emulation/components/UserAgentClientHintsForm.js",
"front_end/panels/settings/emulation/components/userAgentClientHintsForm.css.js",