Commit 87207017 authored by David Tseng's avatar David Tseng Committed by Commit Bot

Fixes speak text under mouse in ChromeVox

Bug: 1047069
Test: manual (there isn't an easy stable way to test this in either js or interactive ui tests).
Change-Id: Ia91a585ec314066a4cceea244e4872a15598cc9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037731Reviewed-by: default avatarHiroki Sato <hirokisato@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738577}
parent d19a5705
......@@ -94,7 +94,7 @@ void AutomationManagerAura::HandleEvent(ax::mojom::Event event_type) {
if (!obj)
return;
AutomationManagerAura::PostEvent(obj->GetUniqueId(), event_type);
PostEvent(obj->GetUniqueId(), event_type);
}
void AutomationManagerAura::HandleAlert(const std::string& text) {
......@@ -141,9 +141,10 @@ AutomationManagerAura::~AutomationManagerAura() = default;
void AutomationManagerAura::Reset(bool reset_serializer) {
if (!current_tree_) {
desktop_root_ = std::make_unique<AXRootObjWrapper>(this, cache_.get());
auto desktop_root = std::make_unique<AXRootObjWrapper>(this, cache_.get());
current_tree_ = std::make_unique<views::AXTreeSourceViews>(
desktop_root_.get(), ax_tree_id(), cache_.get());
desktop_root.get(), ax_tree_id(), cache_.get());
cache_->CreateOrReplace(std::move(desktop_root));
}
if (reset_serializer) {
current_tree_serializer_.reset();
......
......@@ -19,8 +19,6 @@
#include "ui/views/accessibility/ax_event_observer.h"
#include "ui/views/accessibility/ax_tree_source_views.h"
class AXRootObjWrapper;
namespace base {
template <typename T>
class NoDestructor;
......@@ -104,9 +102,6 @@ class AutomationManagerAura : public ui::AXActionHandler,
// Whether automation support for views is enabled.
bool enabled_ = false;
// Root object representing the entire desktop. Must outlive |current_tree_|.
std::unique_ptr<AXRootObjWrapper> desktop_root_;
// Holds the active views-based accessibility tree. A tree currently consists
// of all views descendant to a |Widget| (see |AXTreeSourceViews|).
// A tree becomes active when an event is fired on a descendant view.
......
......@@ -46,6 +46,10 @@ AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(aura::Window* window) {
return CreateInternal<AXWindowObjWrapper>(window, window_to_id_map_);
}
void AXAuraObjCache::CreateOrReplace(std::unique_ptr<AXAuraObjWrapper> obj) {
cache_[obj->GetUniqueId()] = std::move(obj);
}
int32_t AXAuraObjCache::GetID(View* view) const {
return GetIDInternal(view, view_to_id_map_);
}
......
......@@ -55,6 +55,11 @@ class VIEWS_EXPORT AXAuraObjCache : public aura::client::FocusChangeObserver {
AXAuraObjWrapper* GetOrCreate(Widget* widget);
AXAuraObjWrapper* GetOrCreate(aura::Window* window);
// Creates an entry in this cache given a wrapper object. Use this method when
// creating a wrapper not backed by any of the supported views above. This
// cache will take ownership. Will replace an existing entry with the same id.
void CreateOrReplace(std::unique_ptr<AXAuraObjWrapper> obj);
// Gets an id given an Aura view.
int32_t GetID(View* view) const;
int32_t GetID(Widget* widget) const;
......
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