| 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 goog.provide('global'); | 11 goog.provide('global'); |
| 12 | 12 |
| 13 goog.require('AutomationPredicate'); | 13 goog.require('AutomationPredicate'); |
| 14 goog.require('AutomationUtil'); | 14 goog.require('AutomationUtil'); |
| 15 goog.require('ChromeVoxState'); | 15 goog.require('ChromeVoxState'); |
| 16 goog.require('LiveRegions'); | 16 goog.require('LiveRegions'); |
| 17 goog.require('NextEarcons'); | 17 goog.require('NextEarcons'); |
| 18 goog.require('Notifications'); |
| 18 goog.require('Output'); | 19 goog.require('Output'); |
| 19 goog.require('Output.EventType'); | 20 goog.require('Output.EventType'); |
| 20 goog.require('PanelCommand'); | 21 goog.require('PanelCommand'); |
| 21 goog.require('constants'); | 22 goog.require('constants'); |
| 22 goog.require('cursors.Cursor'); | 23 goog.require('cursors.Cursor'); |
| 23 goog.require('cvox.BrailleKeyCommand'); | 24 goog.require('cvox.BrailleKeyCommand'); |
| 24 goog.require('cvox.ChromeVoxEditableTextBase'); | 25 goog.require('cvox.ChromeVoxEditableTextBase'); |
| 25 goog.require('cvox.ChromeVoxKbHandler'); | 26 goog.require('cvox.ChromeVoxKbHandler'); |
| 26 goog.require('cvox.ClassicEarcons'); | 27 goog.require('cvox.ClassicEarcons'); |
| 27 goog.require('cvox.ExtensionBridge'); | 28 goog.require('cvox.ExtensionBridge'); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 138 |
| 138 /** @type {boolean} @private */ | 139 /** @type {boolean} @private */ |
| 139 this.inExcursion_ = false; | 140 this.inExcursion_ = false; |
| 140 | 141 |
| 141 if (!chrome.accessibilityPrivate.setKeyboardListener) | 142 if (!chrome.accessibilityPrivate.setKeyboardListener) |
| 142 chrome.accessibilityPrivate.setKeyboardListener = function() {}; | 143 chrome.accessibilityPrivate.setKeyboardListener = function() {}; |
| 143 | 144 |
| 144 if (cvox.ChromeVox.isChromeOS) { | 145 if (cvox.ChromeVox.isChromeOS) { |
| 145 chrome.accessibilityPrivate.onAccessibilityGesture.addListener( | 146 chrome.accessibilityPrivate.onAccessibilityGesture.addListener( |
| 146 this.onAccessibilityGesture_); | 147 this.onAccessibilityGesture_); |
| 147 } | 148 |
| 148 }; | 149 Notifications.onStartup(); |
| 150 }}; |
| 149 | 151 |
| 150 /** | 152 /** |
| 151 * @const {string} | 153 * @const {string} |
| 152 */ | 154 */ |
| 153 Background.ISSUE_URL = 'https://code.google.com/p/chromium/issues/entry?' + | 155 Background.ISSUE_URL = 'https://code.google.com/p/chromium/issues/entry?' + |
| 154 'labels=Type-Bug,Pri-2,cvox2,OS-Chrome&' + | 156 'labels=Type-Bug,Pri-2,cvox2,OS-Chrome&' + |
| 155 'components=UI>accessibility&' + | 157 'components=UI>accessibility&' + |
| 156 'description='; | 158 'description='; |
| 157 | 159 |
| 158 /** | 160 /** |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 this.startExcursion(); | 644 this.startExcursion(); |
| 643 (new PanelCommand(PanelCommandType.OPEN_MENUS)).send(); | 645 (new PanelCommand(PanelCommandType.OPEN_MENUS)).send(); |
| 644 return false; | 646 return false; |
| 645 case 'toggleSearchWidget': | 647 case 'toggleSearchWidget': |
| 646 (new PanelCommand(PanelCommandType.SEARCH)).send(); | 648 (new PanelCommand(PanelCommandType.SEARCH)).send(); |
| 647 return false; | 649 return false; |
| 648 case 'showKbExplorerPage': | 650 case 'showKbExplorerPage': |
| 649 var explorerPage = {url: 'chromevox/background/kbexplorer.html'}; | 651 var explorerPage = {url: 'chromevox/background/kbexplorer.html'}; |
| 650 chrome.tabs.create(explorerPage); | 652 chrome.tabs.create(explorerPage); |
| 651 break; | 653 break; |
| 654 case 'showNextUpdatePage': |
| 655 var nextUpdatePage = {url: 'cvox2/background/next_update.html'}; |
| 656 chrome.tabs.create(nextUpdatePage); |
| 657 break; |
| 652 case 'decreaseTtsRate': | 658 case 'decreaseTtsRate': |
| 653 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.RATE, false); | 659 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.RATE, false); |
| 654 return false; | 660 return false; |
| 655 case 'increaseTtsRate': | 661 case 'increaseTtsRate': |
| 656 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.RATE, true); | 662 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.RATE, true); |
| 657 return false; | 663 return false; |
| 658 case 'decreaseTtsPitch': | 664 case 'decreaseTtsPitch': |
| 659 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.PITCH, false); | 665 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.PITCH, false); |
| 660 return false; | 666 return false; |
| 661 case 'increaseTtsPitch': | 667 case 'increaseTtsPitch': |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 1152 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
| 1147 .replace(/\*/g, '.*') | 1153 .replace(/\*/g, '.*') |
| 1148 .replace(/\?/g, '.'); | 1154 .replace(/\?/g, '.'); |
| 1149 }).join('|') + ')$'); | 1155 }).join('|') + ')$'); |
| 1150 }; | 1156 }; |
| 1151 | 1157 |
| 1152 /** @type {Background} */ | 1158 /** @type {Background} */ |
| 1153 global.backgroundObj = new Background(); | 1159 global.backgroundObj = new Background(); |
| 1154 | 1160 |
| 1155 }); // goog.scope | 1161 }); // goog.scope |
| OLD | NEW |