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 Abstract interface to methods that differ depending on the | 6 * @fileoverview Abstract interface to methods that differ depending on the |
7 * host platform. | 7 * host platform. |
8 * | 8 * |
9 */ | 9 */ |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 return; | 138 return; |
139 } | 139 } |
140 cvox.ChromeVoxEventWatcher.cleanup(window); | 140 cvox.ChromeVoxEventWatcher.cleanup(window); |
141 switch (state) { | 141 switch (state) { |
142 case cvox.AbstractHost.State.ACTIVE: | 142 case cvox.AbstractHost.State.ACTIVE: |
143 cvox.ChromeVox.isActive = true; | 143 cvox.ChromeVox.isActive = true; |
144 cvox.ChromeVox.navigationManager.showOrHideIndicator(true); | 144 cvox.ChromeVox.navigationManager.showOrHideIndicator(true); |
145 cvox.ChromeVoxEventWatcher.init(window); | 145 cvox.ChromeVoxEventWatcher.init(window); |
146 if (document.activeElement) { | 146 if (document.activeElement) { |
147 var speakNodeAlso = cvox.ChromeVox.documentHasFocus(); | 147 var speakNodeAlso = cvox.ChromeVox.documentHasFocus(); |
148 cvox.ApiImplementation.syncToNode( | 148 cvox.ChromeVox.navigationManager.syncToNode( |
149 document.activeElement, speakNodeAlso); | 149 document.activeElement, speakNodeAlso); |
150 } else { | 150 } else { |
151 cvox.ChromeVox.navigationManager.updateIndicator(); | 151 cvox.ChromeVox.navigationManager.updateIndicator(); |
152 } | 152 } |
153 break; | 153 break; |
154 case cvox.AbstractHost.State.INACTIVE: | 154 case cvox.AbstractHost.State.INACTIVE: |
155 cvox.ChromeVox.isActive = false; | 155 cvox.ChromeVox.isActive = false; |
156 cvox.ChromeVox.navigationManager.showOrHideIndicator(false); | 156 cvox.ChromeVox.navigationManager.showOrHideIndicator(false); |
157 // If ChromeVox is inactive, the event watcher will only listen for key | 157 // If ChromeVox is inactive, the event watcher will only listen for key |
158 // down events. | 158 // down events. |
159 cvox.ChromeVoxEventWatcher.init(window); | 159 cvox.ChromeVoxEventWatcher.init(window); |
160 break; | 160 break; |
161 case cvox.AbstractHost.State.KILLED: | 161 case cvox.AbstractHost.State.KILLED: |
162 cvox.ChromeVox.isActive = false; | 162 cvox.ChromeVox.isActive = false; |
163 cvox.ChromeVox.navigationManager.showOrHideIndicator(false); | 163 cvox.ChromeVox.navigationManager.showOrHideIndicator(false); |
164 break; | 164 break; |
165 } | 165 } |
166 }; | 166 }; |
OLD | NEW |