| 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'); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 /** | 171 /** |
| 172 * Maps a non-desktop root automation node to a range position suitable for | 172 * Maps a non-desktop root automation node to a range position suitable for |
| 173 * restoration. | 173 * restoration. |
| 174 * @type {WeakMap<AutomationNode, cursors.Range>} | 174 * @type {WeakMap<AutomationNode, cursors.Range>} |
| 175 * @private | 175 * @private |
| 176 */ | 176 */ |
| 177 this.focusRecoveryMap_ = new WeakMap(); | 177 this.focusRecoveryMap_ = new WeakMap(); |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 /** | 180 /** |
| 181 * @const {string} | |
| 182 */ | |
| 183 Background.ISSUE_URL = 'https://code.google.com/p/chromium/issues/entry?' + | |
| 184 'labels=Type-Bug,Pri-2,cvox2,OS-Chrome&' + | |
| 185 'components=UI>accessibility&' + | |
| 186 'description='; | |
| 187 | |
| 188 /** | |
| 189 * Map from gesture names (AXGesture defined in ui/accessibility/ax_enums.idl) | 181 * Map from gesture names (AXGesture defined in ui/accessibility/ax_enums.idl) |
| 190 * to commands when in Classic mode. | 182 * to commands when in Classic mode. |
| 191 * @type {Object<string, string>} | 183 * @type {Object<string, string>} |
| 192 * @const | 184 * @const |
| 193 */ | 185 */ |
| 194 Background.GESTURE_CLASSIC_COMMAND_MAP = { | 186 Background.GESTURE_CLASSIC_COMMAND_MAP = { |
| 195 'click': 'forceClickOnCurrentItem', | 187 'click': 'forceClickOnCurrentItem', |
| 196 'swipeUp1': 'backward', | 188 'swipeUp1': 'backward', |
| 197 'swipeDown1': 'forward', | 189 'swipeDown1': 'forward', |
| 198 'swipeLeft1': 'left', | 190 'swipeLeft1': 'left', |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 case cvox.BrailleKeyCommand.ROUTING: | 537 case cvox.BrailleKeyCommand.ROUTING: |
| 546 this.brailleRoutingCommand_( | 538 this.brailleRoutingCommand_( |
| 547 content.text, | 539 content.text, |
| 548 // Cast ok since displayPosition is always defined in this case. | 540 // Cast ok since displayPosition is always defined in this case. |
| 549 /** @type {number} */ (evt.displayPosition)); | 541 /** @type {number} */ (evt.displayPosition)); |
| 550 break; | 542 break; |
| 551 case cvox.BrailleKeyCommand.CHORD: | 543 case cvox.BrailleKeyCommand.CHORD: |
| 552 if (!evt.brailleDots) | 544 if (!evt.brailleDots) |
| 553 return false; | 545 return false; |
| 554 | 546 |
| 555 BrailleCommandHandler.onBrailleCommand(evt.brailleDots); | 547 var command = BrailleCommandHandler.getCommand(evt.brailleDots); |
| 548 if (command) |
| 549 CommandHandler.onCommand(command); |
| 556 break; | 550 break; |
| 557 default: | 551 default: |
| 558 return false; | 552 return false; |
| 559 } | 553 } |
| 560 return true; | 554 return true; |
| 561 }, | 555 }, |
| 562 | 556 |
| 563 /** | 557 /** |
| 564 * Returns true if the url should have Classic running. | 558 * Returns true if the url should have Classic running. |
| 565 * @return {boolean} | 559 * @return {boolean} |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 return new RegExp('^(' + globs.map(function(glob) { | 825 return new RegExp('^(' + globs.map(function(glob) { |
| 832 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 826 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
| 833 .replace(/\*/g, '.*') | 827 .replace(/\*/g, '.*') |
| 834 .replace(/\?/g, '.'); | 828 .replace(/\?/g, '.'); |
| 835 }).join('|') + ')$'); | 829 }).join('|') + ')$'); |
| 836 }; | 830 }; |
| 837 | 831 |
| 838 new Background(); | 832 new Background(); |
| 839 | 833 |
| 840 }); // goog.scope | 834 }); // goog.scope |
| OLD | NEW |