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 A widget hosting an HTML snippet. | 6 * @fileoverview A widget hosting an HTML snippet. |
7 */ | 7 */ |
8 | 8 |
9 goog.provide('cvox.OverlayWidget'); | 9 goog.provide('cvox.OverlayWidget'); |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 | 56 |
57 /** | 57 /** |
58 * @override | 58 * @override |
59 */ | 59 */ |
60 cvox.OverlayWidget.prototype.onKeyDown = function(evt) { | 60 cvox.OverlayWidget.prototype.onKeyDown = function(evt) { |
61 // Allow the base class to handle all keys first. | 61 // Allow the base class to handle all keys first. |
62 goog.base(this, 'onKeyDown', evt); | 62 goog.base(this, 'onKeyDown', evt); |
63 | 63 |
64 // Do not interfere with any key that exits the widget. | 64 // Do not interfere with any key that exits the widget. |
65 if (evt.keyCode == 13 || evt.keyCode == 27) { // Enter or escape. | 65 if (evt.keyCode == 13 || evt.keyCode == 27) { // Enter or escape. |
66 return true; | 66 return true; |
67 } | 67 } |
68 | 68 |
69 // Bound navigation within the snippet for any other key. | 69 // Bound navigation within the snippet for any other key. |
70 var r = cvox.ChromeVox.navigationManager.isReversed(); | 70 var r = cvox.ChromeVox.navigationManager.isReversed(); |
71 if (!cvox.DomUtil.isDescendantOfNode( | 71 if (!cvox.DomUtil.isDescendantOfNode( |
72 cvox.ChromeVox.navigationManager.getCurrentNode(), this.host_)) { | 72 cvox.ChromeVox.navigationManager.getCurrentNode(), this.host_)) { |
73 if (r) { | 73 if (r) { |
74 cvox.ChromeVox.navigationManager.syncToBeginning(); | 74 cvox.ChromeVox.navigationManager.syncToBeginning(); |
75 } else { | 75 } else { |
76 cvox.ChromeVox.navigationManager.updateSelToArbitraryNode(this.host_); | 76 cvox.ChromeVox.navigationManager.updateSelToArbitraryNode(this.host_); |
77 } | 77 } |
78 this.onNavigate(); | 78 this.onNavigate(); |
79 cvox.ChromeVox.navigationManager.speakDescriptionArray( | 79 cvox.ChromeVox.navigationManager.speakDescriptionArray( |
80 cvox.ChromeVox.navigationManager.getDescription(), | 80 cvox.ChromeVox.navigationManager.getDescription(), cvox.QueueMode.FLUSH, |
81 cvox.QueueMode.FLUSH, null); | 81 null); |
82 } | 82 } |
83 return false; | 83 return false; |
84 }; | 84 }; |
OLD | NEW |