| 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 (new PanelCommand(PanelCommandType.OPEN_MENUS, 'table_strategy')) | 665 (new PanelCommand(PanelCommandType.OPEN_MENUS, 'table_strategy')) |
| 664 .send(); | 666 .send(); |
| 665 return false; | 667 return false; |
| 666 case 'toggleSearchWidget': | 668 case 'toggleSearchWidget': |
| 667 (new PanelCommand(PanelCommandType.SEARCH)).send(); | 669 (new PanelCommand(PanelCommandType.SEARCH)).send(); |
| 668 return false; | 670 return false; |
| 669 case 'showKbExplorerPage': | 671 case 'showKbExplorerPage': |
| 670 var explorerPage = {url: 'chromevox/background/kbexplorer.html'}; | 672 var explorerPage = {url: 'chromevox/background/kbexplorer.html'}; |
| 671 chrome.tabs.create(explorerPage); | 673 chrome.tabs.create(explorerPage); |
| 672 break; | 674 break; |
| 675 case 'showNextUpdatePage': |
| 676 var nextUpdatePage = {url: 'cvox2/background/next_update.html'}; |
| 677 chrome.tabs.create(nextUpdatePage); |
| 678 break; |
| 673 case 'decreaseTtsRate': | 679 case 'decreaseTtsRate': |
| 674 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.RATE, false); | 680 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.RATE, false); |
| 675 return false; | 681 return false; |
| 676 case 'increaseTtsRate': | 682 case 'increaseTtsRate': |
| 677 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.RATE, true); | 683 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.RATE, true); |
| 678 return false; | 684 return false; |
| 679 case 'decreaseTtsPitch': | 685 case 'decreaseTtsPitch': |
| 680 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.PITCH, false); | 686 this.increaseOrDecreaseSpeechProperty_(cvox.AbstractTts.PITCH, false); |
| 681 return false; | 687 return false; |
| 682 case 'increaseTtsPitch': | 688 case 'increaseTtsPitch': |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 1181 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
| 1176 .replace(/\*/g, '.*') | 1182 .replace(/\*/g, '.*') |
| 1177 .replace(/\?/g, '.'); | 1183 .replace(/\?/g, '.'); |
| 1178 }).join('|') + ')$'); | 1184 }).join('|') + ')$'); |
| 1179 }; | 1185 }; |
| 1180 | 1186 |
| 1181 /** @type {Background} */ | 1187 /** @type {Background} */ |
| 1182 global.backgroundObj = new Background(); | 1188 global.backgroundObj = new Background(); |
| 1183 | 1189 |
| 1184 }); // goog.scope | 1190 }); // goog.scope |
| OLD | NEW |