Commit f6ad7eee authored by Roman Aleksandrov's avatar Roman Aleksandrov Committed by Commit Bot

LoginAuthUserView: Fix crash

Don't call NotifyAccessibilityEvent on the view being destroyed.

Bug: 1049414
Change-Id: I06c2a9b24a0f03a948582d9706ae4917e2301a7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2057068Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Roman Aleksandrov <raleksandrov@google.com>
Cr-Commit-Position: refs/heads/master@{#741498}
parent a59b9c84
...@@ -138,6 +138,11 @@ ui::CallbackLayerAnimationObserver* BuildObserverToNotifyA11yLocationChanged( ...@@ -138,6 +138,11 @@ ui::CallbackLayerAnimationObserver* BuildObserverToNotifyA11yLocationChanged(
return new ui::CallbackLayerAnimationObserver(base::BindRepeating( return new ui::CallbackLayerAnimationObserver(base::BindRepeating(
[](views::View* view, [](views::View* view,
const ui::CallbackLayerAnimationObserver& observer) { const ui::CallbackLayerAnimationObserver& observer) {
// Don't notify a11y event if the animation is aborted, as |view| may no
// longer be valid.
if (observer.aborted_count())
return true;
view->NotifyAccessibilityEvent(ax::mojom::Event::kLocationChanged, view->NotifyAccessibilityEvent(ax::mojom::Event::kLocationChanged,
false /*send_native_event*/); false /*send_native_event*/);
return true; return true;
...@@ -150,6 +155,11 @@ ui::CallbackLayerAnimationObserver* BuildObserverToNotifyA11yLocationChanged( ...@@ -150,6 +155,11 @@ ui::CallbackLayerAnimationObserver* BuildObserverToNotifyA11yLocationChanged(
return new ui::CallbackLayerAnimationObserver(base::BindRepeating( return new ui::CallbackLayerAnimationObserver(base::BindRepeating(
[](LoginPinView* view, [](LoginPinView* view,
const ui::CallbackLayerAnimationObserver& observer) { const ui::CallbackLayerAnimationObserver& observer) {
// Don't notify a11y event if the animation is aborted, as |view| may no
// longer be valid.
if (observer.aborted_count())
return true;
view->NotifyAccessibilityLocationChanged(); view->NotifyAccessibilityLocationChanged();
return true; return true;
}, },
......
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