Commit 92ed142a authored by Tim Song's avatar Tim Song Committed by Commit Bot

Fix crash when clicking on slide-out settings button of ARC notification.

Opening the inline settings now triggers another surface created event, which
is not currently expected by the ArcAccessibilityHelperBridge. If the
corresponding tree already exists, then we should just return early.

TEST=manually verified
BUG=1042554

Change-Id: Ic689184f54c4a737ddd35d7ed05e42b09d3c21bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003197Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Commit-Queue: Tim Song <tengs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734702}
parent d07d5726
...@@ -360,6 +360,9 @@ void ArcAccessibilityHelperBridge::OnNotificationStateChanged( ...@@ -360,6 +360,9 @@ void ArcAccessibilityHelperBridge::OnNotificationStateChanged(
auto key = KeyForNotification(notification_key); auto key = KeyForNotification(notification_key);
switch (state) { switch (state) {
case arc::mojom::AccessibilityNotificationStateType::SURFACE_CREATED: { case arc::mojom::AccessibilityNotificationStateType::SURFACE_CREATED: {
if (GetFromKey(key))
return;
AXTreeSourceArc* tree_source = CreateFromKey(std::move(key)); AXTreeSourceArc* tree_source = CreateFromKey(std::move(key));
ui::AXTreeData tree_data; ui::AXTreeData tree_data;
if (!tree_source->GetTreeData(&tree_data)) { if (!tree_source->GetTreeData(&tree_data)) {
......
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