| OLD | NEW |
| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 break; | 542 break; |
| 542 case cvox.BrailleKeyCommand.BOTTOM: | 543 case cvox.BrailleKeyCommand.BOTTOM: |
| 543 CommandHandler.onCommand('jumpToBottom'); | 544 CommandHandler.onCommand('jumpToBottom'); |
| 544 break; | 545 break; |
| 545 case cvox.BrailleKeyCommand.ROUTING: | 546 case cvox.BrailleKeyCommand.ROUTING: |
| 546 this.brailleRoutingCommand_( | 547 this.brailleRoutingCommand_( |
| 547 content.text, | 548 content.text, |
| 548 // Cast ok since displayPosition is always defined in this case. | 549 // Cast ok since displayPosition is always defined in this case. |
| 549 /** @type {number} */ (evt.displayPosition)); | 550 /** @type {number} */ (evt.displayPosition)); |
| 550 break; | 551 break; |
| 552 case cvox.BrailleKeyCommand.CHORD: |
| 553 if (!evt.brailleDots) |
| 554 return false; |
| 555 |
| 556 BrailleCommandHandler.onBrailleCommand(evt.brailleDots); |
| 557 break; |
| 551 default: | 558 default: |
| 552 return false; | 559 return false; |
| 553 } | 560 } |
| 554 return true; | 561 return true; |
| 555 }, | 562 }, |
| 556 | 563 |
| 557 /** | 564 /** |
| 558 * Returns true if the url should have Classic running. | 565 * Returns true if the url should have Classic running. |
| 559 * @return {boolean} | 566 * @return {boolean} |
| 560 * @private | 567 * @private |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 return new RegExp('^(' + globs.map(function(glob) { | 820 return new RegExp('^(' + globs.map(function(glob) { |
| 814 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 821 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
| 815 .replace(/\*/g, '.*') | 822 .replace(/\*/g, '.*') |
| 816 .replace(/\?/g, '.'); | 823 .replace(/\?/g, '.'); |
| 817 }).join('|') + ')$'); | 824 }).join('|') + ')$'); |
| 818 }; | 825 }; |
| 819 | 826 |
| 820 new Background(); | 827 new Background(); |
| 821 | 828 |
| 822 }); // goog.scope | 829 }); // goog.scope |
| OLD | NEW |