| 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('ChromeVoxState'); | 15 goog.require('ChromeVoxState'); |
| 16 goog.require('CommandHandler'); | 16 goog.require('CommandHandler'); |
| 17 goog.require('FindHandler'); |
| 17 goog.require('LiveRegions'); | 18 goog.require('LiveRegions'); |
| 18 goog.require('NextEarcons'); | 19 goog.require('NextEarcons'); |
| 19 goog.require('Notifications'); | 20 goog.require('Notifications'); |
| 20 goog.require('Output'); | 21 goog.require('Output'); |
| 21 goog.require('Output.EventType'); | 22 goog.require('Output.EventType'); |
| 22 goog.require('PanelCommand'); | 23 goog.require('PanelCommand'); |
| 23 goog.require('Stubs'); | 24 goog.require('Stubs'); |
| 24 goog.require('constants'); | 25 goog.require('constants'); |
| 25 goog.require('cursors.Cursor'); | 26 goog.require('cursors.Cursor'); |
| 26 goog.require('cvox.BrailleKeyCommand'); | 27 goog.require('cvox.BrailleKeyCommand'); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 /** | 228 /** |
| 228 * Handles a mode change. | 229 * Handles a mode change. |
| 229 * @param {ChromeVoxMode} newMode | 230 * @param {ChromeVoxMode} newMode |
| 230 * @param {?ChromeVoxMode} oldMode Can be null at startup when no range was | 231 * @param {?ChromeVoxMode} oldMode Can be null at startup when no range was |
| 231 * previously set. | 232 * previously set. |
| 232 * @private | 233 * @private |
| 233 */ | 234 */ |
| 234 onModeChanged_: function(newMode, oldMode) { | 235 onModeChanged_: function(newMode, oldMode) { |
| 235 this.keyboardHandler_.onModeChanged(newMode, oldMode); | 236 this.keyboardHandler_.onModeChanged(newMode, oldMode); |
| 236 CommandHandler.onModeChanged(newMode, oldMode); | 237 CommandHandler.onModeChanged(newMode, oldMode); |
| 238 FindHandler.onModeChanged(newMode, oldMode); |
| 237 Notifications.onModeChange(newMode, oldMode); | 239 Notifications.onModeChange(newMode, oldMode); |
| 238 | 240 |
| 239 if (newMode == ChromeVoxMode.CLASSIC) | 241 if (newMode == ChromeVoxMode.CLASSIC) |
| 240 chrome.accessibilityPrivate.setFocusRing([]); | 242 chrome.accessibilityPrivate.setFocusRing([]); |
| 241 | 243 |
| 242 // note that |this.currentRange_| can *change* because the request is | 244 // note that |this.currentRange_| can *change* because the request is |
| 243 // async. Save it to ensure we're looking at the currentRange at this moment | 245 // async. Save it to ensure we're looking at the currentRange at this moment |
| 244 // in time. | 246 // in time. |
| 245 var cur = this.currentRange_; | 247 var cur = this.currentRange_; |
| 246 chrome.tabs.query({active: true, | 248 chrome.tabs.query({active: true, |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 return new RegExp('^(' + globs.map(function(glob) { | 748 return new RegExp('^(' + globs.map(function(glob) { |
| 747 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 749 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
| 748 .replace(/\*/g, '.*') | 750 .replace(/\*/g, '.*') |
| 749 .replace(/\?/g, '.'); | 751 .replace(/\?/g, '.'); |
| 750 }).join('|') + ')$'); | 752 }).join('|') + ')$'); |
| 751 }; | 753 }; |
| 752 | 754 |
| 753 new Background(); | 755 new Background(); |
| 754 | 756 |
| 755 }); // goog.scope | 757 }); // goog.scope |
| OLD | NEW |