Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/platform/browserElements/common/nativeBrowserElementsService.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { ProxyChannel } from '../../../base/parts/ipc/common/ipc.js';
7
import { IMainProcessService } from '../../ipc/common/mainProcessService.js';
8
import { INativeBrowserElementsService } from './browserElements.js';
9
10
// @ts-ignore: interface is implemented via proxy
11
export class NativeBrowserElementsService implements INativeBrowserElementsService {
12
13
declare readonly _serviceBrand: undefined;
14
15
constructor(
16
readonly windowId: number,
17
@IMainProcessService mainProcessService: IMainProcessService
18
) {
19
return ProxyChannel.toService<INativeBrowserElementsService>(mainProcessService.getChannel('browserElements'), {
20
context: windowId,
21
properties: (() => {
22
const properties = new Map<string, unknown>();
23
properties.set('windowId', windowId);
24
25
return properties;
26
})()
27
});
28
}
29
}
30
31
32