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

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: Move DCHECK string into longer comment Created 4 years, 10 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
« no previous file with comments | « chrome/browser/ui/chrome_bubble_manager.h ('k') | chrome/browser/ui/chrome_bubble_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 40d08e667490f1a6b4fcc6399def3f07a6bbb9d5..12b81029fa0bb8012bbcdf6b88c294b8e266dde9 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.
+ CloseBubblesOwnedBy(render_frame_host);
+}
+
void ChromeBubbleManager::DidToggleFullscreenModeForTab(
bool entered_fullscreen, bool will_cause_resize) {
CloseAllBubbles(BUBBLE_CLOSE_FULLSCREEN_TOGGLED);
« no previous file with comments | « chrome/browser/ui/chrome_bubble_manager.h ('k') | chrome/browser/ui/chrome_bubble_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698