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

Unified Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 1899823002: Uses the activedescendant_changed event received from Blink to fire the right focus event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed extraneous focus events. Created 4 years, 8 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
Index: content/browser/accessibility/browser_accessibility_manager.cc
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
index 2eca69ff07851dc6abd6a3e35d83f2310f236565..7dfdbc65d8d87634a52c9bde3682590118d1a708 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -382,18 +382,12 @@ void BrowserAccessibilityManager::OnAccessibilityEvents(
if (event_type == ui::AX_EVENT_FOCUS ||
event_type == ui::AX_EVENT_BLUR) {
if (osk_state_ != OSK_DISALLOWED_BECAUSE_TAB_HIDDEN &&
- osk_state_ != OSK_DISALLOWED_BECAUSE_TAB_JUST_APPEARED)
+ osk_state_ != OSK_DISALLOWED_BECAUSE_TAB_JUST_APPEARED) {
osk_state_ = OSK_ALLOWED;
+ }
- bool is_menu_list_option =
- node->data().role == ui::AX_ROLE_MENU_LIST_OPTION;
-
- // Skip all focus events other than ones on menu list options;
- // we've already handled them, above. Menu list options are a weird
- // exception because the menu list itself has focus but we need to fire
- // focus events on the individual options.
- if (!is_menu_list_option)
- continue;
+ // We already handled all focus events above.
+ continue;
}
// Fire the native event.
@@ -478,9 +472,9 @@ void BrowserAccessibilityManager::ActivateFindInPageResult(
BrowserAccessibility* BrowserAccessibilityManager::GetActiveDescendantFocus(
BrowserAccessibility* focus) {
if (!focus)
- return NULL;
+ return nullptr;
- int active_descendant_id;
+ int32_t active_descendant_id;
if (focus->GetIntAttribute(ui::AX_ATTR_ACTIVEDESCENDANT_ID,
&active_descendant_id)) {
BrowserAccessibility* active_descendant =

Powered by Google App Engine
This is Rietveld 408576698