Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: chrome/browser/resources/keyboard_overlay_accessibility_helper.js

Issue 7628018: Make keyboard overlay speak when ChromeVox is active (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix along review comments Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/keyboard_overlay.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // An object to implement keyboard overlay accessiblity.
6 var KeyboardOverlayAccessibilityHelper = {
7 // Returns true when ChromeVox is loaded and active, false otherwise.
8 cvoxIsActive: function() {
9 return window.cvox && window.cvox.Api.isChromeVoxActive();
10 },
11 // Speaks all the shortcut with the given modifiers.
12 maybeSpeakAllShortcuts: function(modifiers) {
13 if (!this.cvoxIsActive())
14 return;
15 cvox.Api.stop();
16 var keyboardGlyphData = getKeyboardGlyphData();
17 var shortcutData = getShortcutData();
18 var layout = getLayouts()[keyboardGlyphData.layoutName];
19 var keysToShortcutText = {};
20 for (var i = 0; i < layout.length; ++i) {
21 var identifier = remapIdentifier(layout[i][0]);
22 var keyData = keyboardGlyphData.keys[identifier];
23 var keyLabel = getKeyLabel(keyData, modifiers);
24 var shortcutId = shortcutData[getAction(keyLabel, modifiers)];
25 var shortcutText = templateData[shortcutId];
26 var keysText = modifiers.concat(keyLabel).join(' + ');
27 if (shortcutText)
28 keysToShortcutText[keysText] = shortcutText;
29 }
30 for (var keysText in keysToShortcutText) {
31 this.speakShortcut_(keysText, keysToShortcutText[keysText]);
32 }
33 },
34 // Speaks given shortcut description.
35 speakShortcut_: function(keysText, shortcutText) {
36 keysText = keysText.toLowerCase(); // For correct pronunciation.
37 cvox.Api.speak(keysText, 1, {});
38 cvox.Api.speak(shortcutText, 1, {});
39 },
hashimoto 2011/08/16 07:54:56 Moved speakShortcut to the end part of the class b
40 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/keyboard_overlay.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698