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 Base class for all ChromeVox widgets. | 6 * @fileoverview Base class for all ChromeVox widgets. |
7 * | 7 * |
8 * Widgets are keyboard driven and modal mediums for ChromeVox to expose | 8 * Widgets are keyboard driven and modal mediums for ChromeVox to expose |
9 * additional features such as lists, interactive search, or grids. | 9 * additional features such as lists, interactive search, or grids. |
10 */ | 10 */ |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 window.removeEventListener('keypress', this.onKeyPress, true); | 109 window.removeEventListener('keypress', this.onKeyPress, true); |
110 window.removeEventListener('keydown', this.onKeyDown, true); | 110 window.removeEventListener('keydown', this.onKeyDown, true); |
111 cvox.ChromeVox.stickyOverride = null; | 111 cvox.ChromeVox.stickyOverride = null; |
112 | 112 |
113 cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE); | 113 cvox.ChromeVox.earcons.playEarcon(cvox.AbstractEarcons.OBJECT_CLOSE); |
114 if (!opt_noSync) { | 114 if (!opt_noSync) { |
115 this.initialNode = this.initialNode.nodeType == 1 ? | 115 this.initialNode = this.initialNode.nodeType == 1 ? |
116 this.initialNode : this.initialNode.parentNode; | 116 this.initialNode : this.initialNode.parentNode; |
117 cvox.ApiImplementation.syncToNode(this.initialNode, | 117 cvox.ApiImplementation.syncToNode(this.initialNode, |
118 true, | 118 true, |
119 cvox.AbstractTts.QUEUE_MODE_QUEUE); | 119 cvox.QueueMode.QUEUE); |
120 } | 120 } |
121 | 121 |
122 this.active = false; | 122 this.active = false; |
123 }; | 123 }; |
124 | 124 |
125 | 125 |
126 /** | 126 /** |
127 * Toggle between showing and hiding. | 127 * Toggle between showing and hiding. |
128 */ | 128 */ |
129 cvox.Widget.prototype.toggle = function() { | 129 cvox.Widget.prototype.toggle = function() { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 */ | 186 */ |
187 cvox.Widget.prototype.onKeyPress = function(evt) { | 187 cvox.Widget.prototype.onKeyPress = function(evt) { |
188 return false; | 188 return false; |
189 }; | 189 }; |
190 /** | 190 /** |
191 * @return {boolean} True if any widget is currently active. | 191 * @return {boolean} True if any widget is currently active. |
192 */ | 192 */ |
193 cvox.Widget.isActive = function() { | 193 cvox.Widget.isActive = function() { |
194 return (cvox.Widget.ref_ && cvox.Widget.ref_.isActive()) || false; | 194 return (cvox.Widget.ref_ && cvox.Widget.ref_.isActive()) || false; |
195 }; | 195 }; |
OLD | NEW |