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

Unified Diff: chrome/browser/ui/chrome_bubble_manager.cc

Issue 1572743002: Make sure bubbles in Views default to close before their RenderFrameHosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 4 years, 11 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/chrome_bubble_manager.cc
diff --git a/chrome/browser/ui/chrome_bubble_manager.cc b/chrome/browser/ui/chrome_bubble_manager.cc
index 56b686e10ca1619044bdd2c77c79b9b5bf4a104c..9b0deb7951c735b7a0917937172736824bfd92f2 100644
--- a/chrome/browser/ui/chrome_bubble_manager.cc
+++ b/chrome/browser/ui/chrome_bubble_manager.cc
@@ -97,6 +97,9 @@ static void LogBubbleCloseReason(BubbleReference bubble,
case BUBBLE_CLOSE_CANCELED:
UMA_HISTOGRAM_SPARSE_SLOWLY("Bubbles.Close.Canceled", bubble_id);
return;
+ case BUBBLE_CLOSE_FRAME_DESTROYED:
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Bubbles.Close.FrameDestroyed", bubble_id);
+ return;
}
NOTREACHED();
@@ -139,6 +142,14 @@ void ChromeBubbleManager::ActiveTabChanged(content::WebContents* old_contents,
Observe(new_contents);
}
+void ChromeBubbleManager::FrameDeleted(
+ content::RenderFrameHost* render_frame_host) {
+ // When a frame is destroyed, bubbles spawned by that frame should default to
+ // being closed, so that they can't traverse any references they hold to the
+ // destroyed frame.
+ CloseAllBubbles(BUBBLE_CLOSE_FRAME_DESTROYED);
+}
+
void ChromeBubbleManager::DidToggleFullscreenModeForTab(
bool entered_fullscreen) {
CloseAllBubbles(BUBBLE_CLOSE_FULLSCREEN_TOGGLED);

Powered by Google App Engine
This is Rietveld 408576698