Commit de10ebb1 authored by Anupam Snigdha's avatar Anupam Snigdha Committed by Commit Bot

[Narrator] Fix VK show after narrator sets focus

Before this change we used to set the pointer type to touch only when
DoDefaultAction was called. This led to issues as sometimes I don't
see this API being called when narrator is active and the user double
taps on the edit control to set the selection. VK should show up when
caret starts blinking in the edit control, so we set the pointer type
to touch when we receive focus from the narrator and then in blink we
invoke a call to show the VK if the focus happened to be inside an
edit control. FWIW, I discussed this with narrator team and it is
hard to come up with a solution that is deterministic and reliable as
narrator eats up all the gesture events and VK is controlled by a
different component that relies on VK show call from Chromium when
input modality is touch and input policy is set as manual(Chromium
specific). This solution is just a heuristic.

Bug: 1106556
Change-Id: I12fcfcda52ba058ed5377b0312e6652988dacced
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2361045Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Anupam Snigdha <snianu@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#799384}
parent 03adc7f4
...@@ -1804,7 +1804,7 @@ void RenderFrameHostImpl::AccessibilityPerformAction( ...@@ -1804,7 +1804,7 @@ void RenderFrameHostImpl::AccessibilityPerformAction(
} }
// Set the input modality in RenderWidgetHostViewAura to touch so the // Set the input modality in RenderWidgetHostViewAura to touch so the
// VK shows up. // VK shows up.
if (action_data.action == ax::mojom::Action::kDoDefault) { if (action_data.action == ax::mojom::Action::kFocus) {
RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>(
render_view_host_->GetWidget()->GetView()); render_view_host_->GetWidget()->GetView());
if (view) if (view)
......
...@@ -399,6 +399,7 @@ IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewAuraBrowserMockIMETest, ...@@ -399,6 +399,7 @@ IN_PROC_BROWSER_TEST_F(RenderWidgetHostViewAuraBrowserMockIMETest,
AccessibilityNotificationWaiter waiter2( AccessibilityNotificationWaiter waiter2(
shell()->web_contents(), ui::kAXModeComplete, ax::mojom::Event::kFocus); shell()->web_contents(), ui::kAXModeComplete, ax::mojom::Event::kFocus);
GetManager()->SetFocus(*target);
GetManager()->DoDefaultAction(*target); GetManager()->DoDefaultAction(*target);
waiter2.WaitForNotification(); waiter2.WaitForNotification();
......
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