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

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

Issue 2388193003: Always enqueue live regions from background tabs (Closed)
Patch Set: Remove obsolete helper. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util_test.extjs ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js
index 3651e3e626da28274f378345c55f2b01731322d5..9c382a10c575f91567c8b490f58f875fda320fcf 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/live_regions.js
@@ -12,6 +12,7 @@ goog.require('ChromeVoxState');
goog.scope(function() {
var AutomationNode = chrome.automation.AutomationNode;
+var RoleType = chrome.automation.RoleType;
var TreeChange = chrome.automation.TreeChange;
/**
@@ -87,8 +88,11 @@ LiveRegions.prototype = {
if (!currentRange)
return;
+ var webView = AutomationUtil.getTopLevelRoot(node);
+ webView = webView ? webView.parent : null;
if (!LiveRegions.announceLiveRegionsFromBackgroundTabs_ &&
- !AutomationUtil.isInSameWebpage(node, currentRange.start.node)) {
+ currentRange.start.node.role != RoleType.desktop &&
+ (!webView || !webView.state.focused)) {
return;
}
@@ -140,11 +144,17 @@ LiveRegions.prototype = {
if (!output.hasSpeech)
return;
+ // Queue live regions coming from background tabs.
+ var webView = AutomationUtil.getTopLevelRoot(node);
+ webView = webView ? webView.parent : null;
+ var forceQueueForBackgroundedLiveRegion =
+ !webView || !webView.state.focused;
+
// Enqueue live region updates that were received at approximately
// the same time, otherwise flush previous live region updates.
var queueTime = LiveRegions.LIVE_REGION_QUEUE_TIME_MS;
var delta = currentTime - this.lastLiveRegionTime_;
- if (delta > queueTime)
+ if (delta > queueTime && !forceQueueForBackgroundedLiveRegion)
output.withQueueMode(cvox.QueueMode.CATEGORY_FLUSH);
else
output.withQueueMode(cvox.QueueMode.QUEUE);
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_util_test.extjs ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698