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

Unified Diff: chrome/browser/resources/chromeos/switch_access/automation_manager.js

Issue 2868723006: Changing focus ring color by node. Focus ring can now change color without changing bounds (Closed)
Patch Set: Responded to comment Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/ui/focus_ring_layer.cc ('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/switch_access/automation_manager.js
diff --git a/chrome/browser/resources/chromeos/switch_access/automation_manager.js b/chrome/browser/resources/chromeos/switch_access/automation_manager.js
index a26ec16bc8c40f0001f4778a8c583d47590dc890..b23d3deed4e95f3cbc4c0fe4cd968840b32a0ce5 100644
--- a/chrome/browser/resources/chromeos/switch_access/automation_manager.js
+++ b/chrome/browser/resources/chromeos/switch_access/automation_manager.js
@@ -49,6 +49,18 @@ function AutomationManager() {
this.init_();
};
+/**
+ * Highlight colors for the focus ring to distinguish between different types
+ * of nodes.
+ *
+ * @const
+ */
+AutomationManager.Color = {
+ SCOPE: '#de742f', // dark orange
+ GROUP: '#ffbb33', // light orange
+ LEAF: '#78e428' //light green
+};
+
AutomationManager.prototype = {
/**
* Set this.node_, this.root_, and this.desktop_ to the desktop node, and
@@ -83,7 +95,15 @@ AutomationManager.prototype = {
if (node) {
this.node_ = node;
this.printNode_(this.node_);
- chrome.accessibilityPrivate.setFocusRing([this.node_.location]);
+
+ let color;
+ if (this.node_ === this.scope_)
+ color = AutomationManager.Color.SCOPE;
+ else if (AutomationPredicate.isInteresting(this.node_))
+ color = AutomationManager.Color.LEAF;
+ else
+ color = AutomationManager.Color.GROUP;
+ chrome.accessibilityPrivate.setFocusRing([this.node_.location], color);
}
},
@@ -114,6 +134,8 @@ AutomationManager.prototype = {
if (oldScope) {
this.scope_ = oldScope;
this.treeWalker_ = this.createTreeWalker_(this.scope_, this.node_);
+ chrome.accessibilityPrivate.setFocusRing(
+ [this.node_.location], AutomationManager.Color.GROUP);
}
return;
}
« no previous file with comments | « chrome/browser/chromeos/ui/focus_ring_layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698