forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request microsoft#195517 from microsoft/merogge/clear-cue
add clear audio cue, accessible notification service
- Loading branch information
Showing
14 changed files
with
82 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/vs/platform/accessibility/browser/accessibleNotificationService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { Disposable } from 'vs/base/common/lifecycle'; | ||
import { localize } from 'vs/nls'; | ||
import { IAccessibilityService, IAccessibleNotificationService } from 'vs/platform/accessibility/common/accessibility'; | ||
import { AudioCue, IAudioCueService } from 'vs/platform/audioCues/browser/audioCueService'; | ||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; | ||
|
||
export class AccessibleNotificationService extends Disposable implements IAccessibleNotificationService { | ||
declare readonly _serviceBrand: undefined; | ||
|
||
constructor( | ||
@IAudioCueService private readonly _audioCueService: IAudioCueService, | ||
@IConfigurationService private readonly _configurationService: IConfigurationService, | ||
@IAccessibilityService private readonly _accessibilityService: IAccessibilityService) { | ||
super(); | ||
} | ||
|
||
notifyCleared(): void { | ||
const audioCueValue = this._configurationService.getValue(AudioCue.clear.settingsKey); | ||
if (audioCueValue === 'on' || audioCueValue === 'auto' && this._accessibilityService.isScreenReaderOptimized()) { | ||
this._audioCueService.playAudioCue(AudioCue.clear); | ||
} else { | ||
alert(localize('cleared', "Cleared")); | ||
} | ||
} | ||
} | ||
|
||
export class TestAccessibleNotificationService extends Disposable implements IAccessibleNotificationService { | ||
|
||
declare readonly _serviceBrand: undefined; | ||
|
||
notifyCleared(): void { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters