#50513: chore: remove dead C++ code from shell/
Removes unreferenced C++ code found via codebase sweep (+7 / −222 across 21 files).
⚠️ Review ask: Several of these may indicate missing functionality rather than truly-unused code. I've flagged the ones that look suspicious below — please confirm whether these were intentionally left unwired or if there's a latent bug.
Possibly a bug, not just dead code
-
ElectronNavigationUIData(deleted class) — Added in #17440 for extensions support but never instantiated.ElectronBrowserClientdoesn't overrideGetNavigationUIData()to return it; code uses upstreamExtensionNavigationUIDatadirectly. If this was meant to carry Electron-specific navigation data for extensions, it never did. cc @samuelmaddock -
InspectableWebContents::synced_setting_names_— Added in #33120 "fix: settings not persisting across devtools loads" but the member is never populated or read. If DevTools synced-settings registration was meant to use this, it's not wired up. cc @codebytere -
friend class NativeWindowsViewsinframeless_view.h— typo forNativeWindowViews(no extra 's'), added in #29600. Code compiles because the friendship was never exercised, but ifNativeWindowViewswas meant to access private members here, it currently can't. cc @mlaurencin -
BuildMenuItemWithImage(..., GtkWidget*)header signature — the implementation actually takesconst gfx::Image&. The header declared a function that never existed. Corrected the signature to match the impl.
Straightforward dead code
CertificateManagerModel: removedImportUserCert,ImportCACerts,ImportServerCert,Delete, andis_user_db_available_— forked from Chrome's cert manager UI, but only the PKCS12 import path is used byapp.importCertificate()gtk_util::GetOpenLabel/GetSaveLabel— orphaned by #42045 when Linux file dialogs moved to//ui/shell_dialogs(cc @codebytere)WinFrameView::GetReadableFeatureColor— implementation removed in #48568, header declaration left behind (cc @codebytere)AutofillDriverFactory::AddDriverForFrame+CreationCallback—DriverForFrame()creates on demand, explicit-add path never invokedZoomLevelDelegate::SetDefaultZoomLevelPref— only the getter is usedAutofillPopup::selected_index_— declared, never read or written- Forward decls:
WebDialogHelper(class removed in #30663),ChromeContentRendererClient,ElectronNativeWindowObserver,ValueStoreFactory(redundant with existing include)
Not in this PR
ProxyingWebSocket::additional_headers_ is also dead (iterated but never populated) — same bug exists in upstream Chromium. Handling separately.
Notes: none
Backports
No Backports Requested
This pull request doesn't have any backports requested or created for older release branches.
What are backports?
Backports are copies of changes made to the main branch that are applied to older release branches. They ensure that bug fixes and important changes are available in maintained older versions of Electron.
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron