| 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('cvox2.Background'); | 10 goog.provide('cvox2.Background'); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 }, | 87 }, |
| 88 | 88 |
| 89 /** | 89 /** |
| 90 * A generic handler for all desktop automation events. | 90 * A generic handler for all desktop automation events. |
| 91 * @param {AutomationEvent} evt The event. | 91 * @param {AutomationEvent} evt The event. |
| 92 */ | 92 */ |
| 93 onAutomationEvent: function(evt) { | 93 onAutomationEvent: function(evt) { |
| 94 var output = evt.target.attributes.name + ' ' + evt.target.role; | 94 var output = evt.target.attributes.name + ' ' + evt.target.role; |
| 95 cvox.ChromeVox.tts.speak(output, cvox.AbstractTts.QUEUE_MODE_FLUSH); | 95 cvox.ChromeVox.tts.speak(output, cvox.AbstractTts.QUEUE_MODE_FLUSH); |
| 96 cvox.ChromeVox.braille.write(cvox.NavBraille.fromText(output)); | 96 cvox.ChromeVox.braille.write(cvox.NavBraille.fromText(output)); |
| 97 chrome.accessibilityPrivate.setFocusRing([evt.target.location]); |
| 97 }, | 98 }, |
| 98 | 99 |
| 99 /** | 100 /** |
| 100 * Handles chrome.commands.onCommand. | 101 * Handles chrome.commands.onCommand. |
| 101 * @param {string} command | 102 * @param {string} command |
| 102 */ | 103 */ |
| 103 onGotCommand: function(command) { | 104 onGotCommand: function(command) { |
| 104 }, | 105 }, |
| 105 | 106 |
| 106 /** | 107 /** |
| (...skipping 14 matching lines...) Expand all Loading... |
| 121 disableClassicChromeVox_: function(tabId) { | 122 disableClassicChromeVox_: function(tabId) { |
| 122 chrome.tabs.executeScript( | 123 chrome.tabs.executeScript( |
| 123 tabId, | 124 tabId, |
| 124 {'code': 'try { window.disableChromeVox(); } catch(e) { }\n', | 125 {'code': 'try { window.disableChromeVox(); } catch(e) { }\n', |
| 125 'allFrames': true}); | 126 'allFrames': true}); |
| 126 } | 127 } |
| 127 }; | 128 }; |
| 128 | 129 |
| 129 /** @type {cvox2.Background} */ | 130 /** @type {cvox2.Background} */ |
| 130 cvox2.global.backgroundObj = new cvox2.Background(); | 131 cvox2.global.backgroundObj = new cvox2.Background(); |
| OLD | NEW |