Commit fb4ffc9a authored by Yuki Awano's avatar Yuki Awano Committed by Commit Bot

Update kAccessibilityFocusFallsbackToWidgetKey

- Update kAccessibilityFocusFallsbackToWidgetKey depending on whether
  ChromeVox or TalkBack is used for the window.
- This CL fixes the logic to update window properties. AxTree can arrive
  to the helper bridge after a window is activated. This CL adds a logic
  to fix it.

      confirm that it works.

Bug: 866793
Test: Navigate Android window with TalkBack by using keyboard and
Change-Id: I911c77229c9a6f338fcdadd81ea5642aaefae084
Reviewed-on: https://chromium-review.googlesource.com/1148099Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Yuki Awano <yawano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578521}
parent 027497d3
......@@ -278,6 +278,10 @@ void ArcAccessibilityHelperBridge::OnAccessibilityEvent(
ax::mojom::Event::kTextSelectionChanged, true);
}
}
} else if (!is_notification_event &&
event_data->event_type ==
arc::mojom::AccessibilityEventType::WINDOW_STATE_CHANGED) {
UpdateWindowProperties(GetActiveWindow());
}
return;
......@@ -560,6 +564,8 @@ void ArcAccessibilityHelperBridge::UpdateWindowProperties(
window->SetProperty(aura::client::kAccessibilityTouchExplorationPassThrough,
use_talkback);
window->SetProperty(ash::kSearchKeyAcceleratorReservedKey, use_talkback);
window->SetProperty(aura::client::kAccessibilityFocusFallsbackToWidgetKey,
!use_talkback);
}
aura::Window* ArcAccessibilityHelperBridge::GetActiveWindow() {
......
......@@ -1199,10 +1199,6 @@ void ShellSurfaceBase::CreateShellSurfaceWidget(
aura::Window* window = widget_->GetNativeWindow();
window->SetName("ExoShellSurface");
// TODO(yawano): This needs to be set to false if TalkBack is handling this
// window.
window->SetProperty(aura::client::kAccessibilityFocusFallsbackToWidgetKey,
true);
window->AddChild(host_window());
// Use DESCENDANTS_ONLY event targeting policy for mus/mash.
// TODO(https://crbug.com/839521): Revisit after event dispatching code is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment