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

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

Issue 12022002: Fixing activation states from the new launcher. Also adding a whole bunch of unit tests for the new… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgotten to add file to repository Created 7 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/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 6761807e731db87d91adccba1e69fbd848dbb837..5a6d18b5175d5ef36c1eb6f2fb2d56ad0126789e 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -823,6 +823,11 @@ bool BrowserView::IsAlwaysOnTop() const {
}
gfx::NativeWindow BrowserView::GetNativeWindow() {
+ // While the browser destruction is going on, the widget can already be gone,
+ // but utility functions like FindBrowserWithWindow will come here and crash.
+ // We short circuit therefore.
+ if (!GetWidget())
+ return NULL;
return GetWidget()->GetTopLevelWidget()->GetNativeWindow();
}

Powered by Google App Engine
This is Rietveld 408576698