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

Unified Diff: chrome/renderer/resources/extensions/automation_custom_bindings.js

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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/renderer/plugins/plugin_uma.cc ('k') | chrome/renderer/safe_browsing/features.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/automation_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/automation_custom_bindings.js b/chrome/renderer/resources/extensions/automation_custom_bindings.js
index 350f2179df2d8a1e1e814ffdaa5f60cb9d8b18ec..10fd29d0609708f8dee99df03c2d0a9fd36de032 100644
--- a/chrome/renderer/resources/extensions/automation_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js
@@ -278,10 +278,22 @@ automationInternal.onAccessibilityEvent.addListener(function(eventParams) {
var id = eventParams.treeID;
var targetTree = AutomationRootNode.getOrCreate(id);
+ // Work around an issue where Chrome sends us 'blur' events on the
+ // root node when nothing has focus, we need to treat those as focus
+ // events but otherwise not handle blur events specially.
+ var isFocusEvent = false;
+ if (eventParams.eventType == schema.EventType.focus) {
+ isFocusEvent = true;
+ } else if (eventParams.eventType == schema.EventType.blur) {
+ var node = privates(targetTree).impl.get(eventParams.targetID);
+ if (node == node.root)
+ isFocusEvent = true;
+ }
+
// When we get a focus event, ignore the actual event target, and instead
// check what node has focus globally. If that represents a focus change,
// fire a focus event on the correct target.
- if (eventParams.eventType == schema.EventType.focus) {
+ if (isFocusEvent) {
var previousFocusedNode = automationUtil.focusedNode;
automationUtil.updateFocusedNode();
if (automationUtil.focusedNode &&
« no previous file with comments | « chrome/renderer/plugins/plugin_uma.cc ('k') | chrome/renderer/safe_browsing/features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698