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 Accesses Chrome's tabs extension API and gives | 6 * @fileoverview Accesses Chrome's tabs extension API and gives |
7 * feedback for events that happen in the "Chrome of Chrome". | 7 * feedback for events that happen in the "Chrome of Chrome". |
8 */ | 8 */ |
9 | 9 |
10 goog.provide('cvox.TabsApiHandler'); | 10 goog.provide('cvox.TabsApiHandler'); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 * Installs a new automation handler for the given tab. | 192 * Installs a new automation handler for the given tab. |
193 * @param {number} tabId | 193 * @param {number} tabId |
194 * @private | 194 * @private |
195 */ | 195 */ |
196 refreshAutomationHandler_: function(tabId) { | 196 refreshAutomationHandler_: function(tabId) { |
197 if (!cvox.ChromeVox.isMac) | 197 if (!cvox.ChromeVox.isMac) |
198 return; | 198 return; |
199 | 199 |
200 chrome.automation.getTree(tabId, function(node) { | 200 chrome.automation.getTree(tabId, function(node) { |
201 if (this.handler_) | 201 if (this.handler_) |
202 this.handler_.unregister(); | 202 this.handler_.removeAllListeners(); |
203 | 203 |
204 this.handler_ = new TabsAutomationHandler(node); | 204 this.handler_ = new TabsAutomationHandler(node); |
205 }.bind(this)); | 205 }.bind(this)); |
206 }, | 206 }, |
207 | 207 |
208 /** | 208 /** |
209 * @param {number} id Tab id to focus. | 209 * @param {number} id Tab id to focus. |
210 * @private | 210 * @private |
211 */ | 211 */ |
212 focusTab_: function(id) { | 212 focusTab_: function(id) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 }, | 251 }, |
252 | 252 |
253 /** | 253 /** |
254 * @return {boolean} True if the page loading sound is playing and our | 254 * @return {boolean} True if the page loading sound is playing and our |
255 * page loading timer is active. | 255 * page loading timer is active. |
256 */ | 256 */ |
257 isPlayingPageLoadingSound_: function() { | 257 isPlayingPageLoadingSound_: function() { |
258 return this.pageLoadIntervalID_ != null; | 258 return this.pageLoadIntervalID_ != null; |
259 } | 259 } |
260 }; | 260 }; |
OLD | NEW |