Commit 86e8fc83 authored by David Black's avatar David Black Committed by Commit Bot

Fix crash in proactive suggestions.

Hover changed events may be propagated during the widget close
sequence. Previously, this could cause us to schedule a timer to auto-
close the proactive suggestions view which would crash when firing due
to the widget no longer existing.

Bug: b:141386438
Change-Id: Ia2a2cf8ba11c9f1209df857edccbd160e1be45c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1817762Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#699078}
parent 7ce971d5
......@@ -300,6 +300,15 @@ void AssistantUiController::OnProactiveSuggestionsCloseButtonPressed() {
void AssistantUiController::OnProactiveSuggestionsViewHoverChanged(
bool is_hovering) {
if (!proactive_suggestions_view_ ||
!proactive_suggestions_view_->GetWidget() ||
proactive_suggestions_view_->GetWidget()->IsClosed()) {
// Hover changed events may occur during the proactive suggestions widget's
// close sequence. When this occurs, we quit early as the proactive
// suggestions view is being destroyed.
return;
}
if (!is_hovering) {
// When the user is no longer hovering over the proactive suggestions view
// we need to reset the timer so that it will auto-close appropriately.
......
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