refactor ui element selection to standalone service (#248185)

* big refator to ui element's own service

* move native to own file

* add native type

* fix in layer checker

* fix in layer checker

* fix whitespace

* fix another whitespace

* Update layersChecker.js

* build still not passing

* Update layersChecker.js

* update layerChecker using npm run compile

* try updating layer checker rules

* rename simple browser service

* another rename in app.ts
This commit is contained in:
Justin Chen
2025-05-07 01:24:21 -07:00
committed by GitHub
parent 49dc138e83
commit 94590884c8
18 changed files with 562 additions and 360 deletions

View File

@@ -35,6 +35,7 @@ import { DiagnosticsMainService, IDiagnosticsMainService } from '../../platform/
import { DialogMainService, IDialogMainService } from '../../platform/dialogs/electron-main/dialogMainService.js';
import { IEncryptionMainService } from '../../platform/encryption/common/encryptionService.js';
import { EncryptionMainService } from '../../platform/encryption/electron-main/encryptionMainService.js';
import { NativeBrowserElementsMainService, INativeBrowserElementsMainService } from '../../platform/browserElements/electron-main/nativeBrowserElementsMainService.js';
import { NativeParsedArgs } from '../../platform/environment/common/argv.js';
import { IEnvironmentMainService } from '../../platform/environment/electron-main/environmentMainService.js';
import { isLaunchedFromCli } from '../../platform/environment/node/argvHelper.js';
@@ -1023,6 +1024,9 @@ export class CodeApplication extends Disposable {
// Encryption
services.set(IEncryptionMainService, new SyncDescriptor(EncryptionMainService));
// Browser Elements
services.set(INativeBrowserElementsMainService, new SyncDescriptor(NativeBrowserElementsMainService, undefined, false /* proxied to other processes */));
// Keyboard Layout
services.set(IKeyboardLayoutMainService, new SyncDescriptor(KeyboardLayoutMainService));
@@ -1165,6 +1169,11 @@ export class CodeApplication extends Disposable {
const encryptionChannel = ProxyChannel.fromService(accessor.get(IEncryptionMainService), disposables);
mainProcessElectronServer.registerChannel('encryption', encryptionChannel);
// Browser Elements
const browserElementsChannel = ProxyChannel.fromService(accessor.get(INativeBrowserElementsMainService), disposables);
mainProcessElectronServer.registerChannel('browserElements', browserElementsChannel);
sharedProcessClient.then(client => client.registerChannel('browserElements', browserElementsChannel));
// Signing
const signChannel = ProxyChannel.fromService(accessor.get(ISignService), disposables);
mainProcessElectronServer.registerChannel('sign', signChannel);