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

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

Issue 2104663003: Prepare ChromeVox for webstore release. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix key maps. Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 Implements support for live regions in ChromeVox Next. 6 * @fileoverview Implements support for live regions in ChromeVox Next.
7 */ 7 */
8 8
9 goog.provide('LiveRegions'); 9 goog.provide('LiveRegions');
10 10
(...skipping 23 matching lines...) Expand all
34 */ 34 */
35 this.lastLiveRegionTime_ = new Date(0); 35 this.lastLiveRegionTime_ = new Date(0);
36 36
37 /** 37 /**
38 * Set of nodes that have been announced as part of a live region since 38 * Set of nodes that have been announced as part of a live region since
39 * |this.lastLiveRegionTime_|, to prevent duplicate announcements. 39 * |this.lastLiveRegionTime_|, to prevent duplicate announcements.
40 * @type {!WeakSet<AutomationNode>} 40 * @type {!WeakSet<AutomationNode>}
41 * @private 41 * @private
42 */ 42 */
43 this.liveRegionNodeSet_ = new WeakSet(); 43 this.liveRegionNodeSet_ = new WeakSet();
44 44 chrome.automation.addTreeChangeObserver(
45 // API only exists >= m49. Prevent us from crashing. 45 'liveRegionTreeChanges', this.onTreeChange.bind(this));
46 try {
47 chrome.automation.addTreeChangeObserver(
48 'liveRegionTreeChanges', this.onTreeChange.bind(this));
49 } catch (e) {
50 }
51 }; 46 };
52 47
53 /** 48 /**
54 * Live region events received in fewer than this many milliseconds will 49 * Live region events received in fewer than this many milliseconds will
55 * queue, otherwise they'll be output with a category flush. 50 * queue, otherwise they'll be output with a category flush.
56 * @type {number} 51 * @type {number}
57 * @const 52 * @const
58 */ 53 */
59 LiveRegions.LIVE_REGION_QUEUE_TIME_MS = 500; 54 LiveRegions.LIVE_REGION_QUEUE_TIME_MS = 500;
60 55
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return; 149 return;
155 parent = parent.parent; 150 parent = parent.parent;
156 } 151 }
157 152
158 this.liveRegionNodeSet_.add(node); 153 this.liveRegionNodeSet_.add(node);
159 output.go(); 154 output.go();
160 }, 155 },
161 }; 156 };
162 157
163 }); // goog.scope 158 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698