Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(832)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/chromevox/background/tabs_api_handler.js

Issue 1942683005: Refactor event handler classes to make it easier to add new event type listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698