Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/services/accessibility/common/accessibleViewInformationService.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 { Disposable } from '../../../../base/common/lifecycle.js';
7
import { ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX } from '../../../../platform/accessibility/common/accessibility.js';
8
import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
9
import { IStorageService, StorageScope } from '../../../../platform/storage/common/storage.js';
10
11
export interface IAccessibleViewInformationService {
12
_serviceBrand: undefined;
13
hasShownAccessibleView(viewId: string): boolean;
14
}
15
16
export const IAccessibleViewInformationService = createDecorator<IAccessibleViewInformationService>('accessibleViewInformationService');
17
18
export class AccessibleViewInformationService extends Disposable implements IAccessibleViewInformationService {
19
declare readonly _serviceBrand: undefined;
20
constructor(@IStorageService private readonly _storageService: IStorageService) {
21
super();
22
}
23
hasShownAccessibleView(viewId: string): boolean {
24
return this._storageService.getBoolean(`${ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX}${viewId}`, StorageScope.APPLICATION, false) === true;
25
}
26
}
27
28