Commit bbf55256 authored by David Black's avatar David Black Committed by Commit Bot

Handle ChromeVox Search + Space to "press" holding space items.

Search + Space propagates to the view as mouse events. Unfortunately we
can't tell from the mouse event if the event was created by ChromeVox
but its good enough to just check if ChromeVox is enabled.

Bug: 1137039
Change-Id: I0ed18774632b0e46bf6100d86a27abbf5df29f85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466165Reviewed-by: default avatarAhmed Mehfooz <amehfooz@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#816340}
parent 052bc3e7
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "ash/system/holding_space/holding_space_item_view_delegate.h" #include "ash/system/holding_space/holding_space_item_view_delegate.h"
#include "ash/accessibility/accessibility_controller_impl.h"
#include "ash/public/cpp/holding_space/holding_space_client.h" #include "ash/public/cpp/holding_space/holding_space_client.h"
#include "ash/public/cpp/holding_space/holding_space_constants.h" #include "ash/public/cpp/holding_space/holding_space_constants.h"
#include "ash/public/cpp/holding_space/holding_space_controller.h" #include "ash/public/cpp/holding_space/holding_space_controller.h"
...@@ -11,6 +12,7 @@ ...@@ -11,6 +12,7 @@
#include "ash/public/cpp/holding_space/holding_space_metrics.h" #include "ash/public/cpp/holding_space/holding_space_metrics.h"
#include "ash/public/cpp/holding_space/holding_space_model.h" #include "ash/public/cpp/holding_space/holding_space_model.h"
#include "ash/resources/vector_icons/vector_icons.h" #include "ash/resources/vector_icons/vector_icons.h"
#include "ash/shell.h"
#include "ash/strings/grit/ash_strings.h" #include "ash/strings/grit/ash_strings.h"
#include "ash/system/holding_space/holding_space_item_view.h" #include "ash/system/holding_space/holding_space_item_view.h"
#include "base/bind.h" #include "base/bind.h"
...@@ -107,6 +109,19 @@ bool HoldingSpaceItemViewDelegate::OnHoldingSpaceItemViewMousePressed( ...@@ -107,6 +109,19 @@ bool HoldingSpaceItemViewDelegate::OnHoldingSpaceItemViewMousePressed(
// clear any view that we had cached to ignore mouse released events for. // clear any view that we had cached to ignore mouse released events for.
ignore_mouse_released_ = nullptr; ignore_mouse_released_ = nullptr;
// If ChromeVox is enabled, we assume this mouse `event` to be a result of
// having pressed Search + Space. In this case, we'll open the selected
// holding space items. If the "pressed" `view` is not part of the current
// selection it will become the entire selection.
const bool spoken_feedback_enabled =
Shell::Get()->accessibility_controller()->spoken_feedback().enabled();
if (spoken_feedback_enabled) {
if (!view->selected())
SetSelection(view);
OpenItems(GetSelection());
return true;
}
// If the `view` is already selected, mouse press is a no-op. Actions taken on // If the `view` is already selected, mouse press is a no-op. Actions taken on
// selected views are performed on mouse released in order to give drag/drop // selected views are performed on mouse released in order to give drag/drop
// a chance to take effect (assuming that drag thresholds are met). // a chance to take effect (assuming that drag thresholds are met).
......
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