Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Unified Diff: chrome/browser/ui/views/exclusive_access_bubble_views.cc

Issue 2850403002: Fix crash under ExclusiveAccessBubbleViews::AnimationProgressed(). (Closed)
Patch Set: respond to comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/exclusive_access_bubble_views.cc
diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views.cc b/chrome/browser/ui/views/exclusive_access_bubble_views.cc
index b556c88b3dbddd219b87d267ca7472b4ff7f5870..7040d6b08f6ab641bccdae3efc32c2dffd47b204 100644
--- a/chrome/browser/ui/views/exclusive_access_bubble_views.cc
+++ b/chrome/browser/ui/views/exclusive_access_bubble_views.cc
@@ -282,6 +282,23 @@ void ExclusiveAccessBubbleViews::Observe(
UpdateMouseWatcher();
}
+void ExclusiveAccessBubbleViews::OnWidgetDestroyed(views::Widget* widget) {
+ // Although SubtleNotificationView uses WIDGET_OWNS_NATIVE_WIDGET, a close can
+ // originate from the OS or some Chrome shutdown codepaths that bypass the
+ // destructor.
+ views::Widget* popup_on_stack = popup_;
+ DCHECK(popup_on_stack->HasObserver(this));
+
+ // Get ourselves destroyed. Calling ExitExclusiveAccess() won't work because
+ // the parent window might be destroyed as well, so asking it to exit
+ // fullscreen would be a bad idea.
+ bubble_view_context_->DestroyAnyExclusiveAccessBubble();
+
+ // Note: |this| is destroyed on the line above. Check that the destructor was
+ // invoked. This is safe to do since |popup_| is deleted via a posted task.
+ DCHECK(!popup_on_stack->HasObserver(this));
+}
+
void ExclusiveAccessBubbleViews::OnWidgetVisibilityChanged(
views::Widget* widget,
bool visible) {

Powered by Google App Engine
This is Rietveld 408576698