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

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: Fixed problem with ASAN unittest 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 a9ae54db735e788cbf0ca75f07b00e477a07b553..348db6ce3d4d5fbf945925d470c27543b914dd73 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -642,6 +642,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();
}
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698