Commit d44b8bec authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

Desks: Fix a crash when ChromeVox is enabled

When a mini_view is removed, it outlives its desk, but ChromeVox
may try to get the accessible node data at this point when `desk_`
is nullptr.

BUG=999595
TEST=Manual

Change-Id: I62ebc62f4dee67e03da6fb5d588520451f9e85ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1779184Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692142}
parent 7d2e5979
...@@ -186,7 +186,8 @@ gfx::Size DeskMiniView::CalculatePreferredSize() const { ...@@ -186,7 +186,8 @@ gfx::Size DeskMiniView::CalculatePreferredSize() const {
void DeskMiniView::GetAccessibleNodeData(ui::AXNodeData* node_data) { void DeskMiniView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
views::Button::GetAccessibleNodeData(node_data); views::Button::GetAccessibleNodeData(node_data);
if (desk_->is_active()) { // Note that the desk may have already been destroyed.
if (desk_ && desk_->is_active()) {
node_data->AddStringAttribute( node_data->AddStringAttribute(
ax::mojom::StringAttribute::kValue, ax::mojom::StringAttribute::kValue,
l10n_util::GetStringUTF8( l10n_util::GetStringUTF8(
......
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