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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 2015223002: MacViews: Fixed BrowserViewTest.CloseWithTabsStartWithActive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DestroyBrowserWebContents. Created 4 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/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 2eb4e5135e4df4ad6b7d16d114f9312699730ab9..014defcc9b5234a3154969c2894f7a5e2a8a0178 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1752,6 +1752,15 @@ views::ClientView* BrowserView::CreateClientView(views::Widget* widget) {
return this;
}
+void BrowserView::OnWidgetDestroying(views::Widget* widget) {
+ // Destroy any remaining WebContents early on. Doing so may result in
+ // calling back to one of the Views/LayoutManagers or supporting classes of
+ // BrowserView. By destroying here we ensure all said classes are valid.
+ ScopedVector<content::WebContents> contents;
+ while (browser()->tab_strip_model()->count())
+ contents.push_back(browser()->tab_strip_model()->DetachWebContentsAt(0));
+}
+
void BrowserView::OnWidgetActivationChanged(views::Widget* widget,
bool active) {
if (active)
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698