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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js

Issue 2463983002: Implement support for chorded braille commands (Closed)
Patch Set: Add more commands. Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview The entry point for all ChromeVox2 related code for the 6 * @fileoverview The entry point for all ChromeVox2 related code for the
7 * background page. 7 * background page.
8 */ 8 */
9 9
10 goog.provide('Background'); 10 goog.provide('Background');
11 11
12 goog.require('AutomationPredicate'); 12 goog.require('AutomationPredicate');
13 goog.require('AutomationUtil'); 13 goog.require('AutomationUtil');
14 goog.require('BackgroundKeyboardHandler'); 14 goog.require('BackgroundKeyboardHandler');
15 goog.require('BrailleCommandHandler');
15 goog.require('ChromeVoxState'); 16 goog.require('ChromeVoxState');
16 goog.require('CommandHandler'); 17 goog.require('CommandHandler');
17 goog.require('FindHandler'); 18 goog.require('FindHandler');
18 goog.require('LiveRegions'); 19 goog.require('LiveRegions');
19 goog.require('NextEarcons'); 20 goog.require('NextEarcons');
20 goog.require('Notifications'); 21 goog.require('Notifications');
21 goog.require('Output'); 22 goog.require('Output');
22 goog.require('Output.EventType'); 23 goog.require('Output.EventType');
23 goog.require('PanelCommand'); 24 goog.require('PanelCommand');
24 goog.require('Stubs'); 25 goog.require('Stubs');
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 CommandHandler.onCommand('jumpToTop'); 532 CommandHandler.onCommand('jumpToTop');
532 break; 533 break;
533 case cvox.BrailleKeyCommand.BOTTOM: 534 case cvox.BrailleKeyCommand.BOTTOM:
534 CommandHandler.onCommand('jumpToBottom'); 535 CommandHandler.onCommand('jumpToBottom');
535 break; 536 break;
536 case cvox.BrailleKeyCommand.ROUTING: 537 case cvox.BrailleKeyCommand.ROUTING:
537 this.brailleRoutingCommand_( 538 this.brailleRoutingCommand_(
538 content.text, 539 content.text,
539 // Cast ok since displayPosition is always defined in this case. 540 // Cast ok since displayPosition is always defined in this case.
540 /** @type {number} */ (evt.displayPosition)); 541 /** @type {number} */ (evt.displayPosition));
542 break;
dmazzoni 2016/11/01 16:22:37 nit: indentation
David Tseng 2016/11/01 20:11:59 Done.
543 case cvox.BrailleKeyCommand.CHORD:
544 if (!evt.brailleDots)
545 return false;
546
547 BrailleCommandHandler.onBrailleCommand(evt.brailleDots);
541 break; 548 break;
542 default: 549 default:
543 return false; 550 return false;
544 } 551 }
545 return true; 552 return true;
546 }, 553 },
547 554
548 /** 555 /**
549 * Returns true if the url should have Classic running. 556 * Returns true if the url should have Classic running.
550 * @return {boolean} 557 * @return {boolean}
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 return new RegExp('^(' + globs.map(function(glob) { 799 return new RegExp('^(' + globs.map(function(glob) {
793 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') 800 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&')
794 .replace(/\*/g, '.*') 801 .replace(/\*/g, '.*')
795 .replace(/\?/g, '.'); 802 .replace(/\?/g, '.');
796 }).join('|') + ')$'); 803 }).join('|') + ')$');
797 }; 804 };
798 805
799 new Background(); 806 new Background();
800 807
801 }); // goog.scope 808 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698