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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 23904005: Fixes crah in NativeWidgetAura::IsActive() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index f9ebed7e85f388a420e328720d7936ed7b80cc52..86012a5b5c49a84a21366e22678f38dd30a5b3ea 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -521,9 +521,14 @@ void NativeWidgetAura::Deactivate() {
}
bool NativeWidgetAura::IsActive() const {
- return window_ &&
- aura::client::GetActivationClient(window_->GetRootWindow())->
- GetActiveWindow() == window_;
+ if (!window_)
+ return false;
+
+ // We may up here during destruction of the root, in which case
+ // GetRootWindow() returns NULL (~RootWindow() has run and we're in ~Window).
+ aura::RootWindow* root = window_->GetRootWindow();
+ return root &&
+ aura::client::GetActivationClient(root)->GetActiveWindow() == window_;
}
void NativeWidgetAura::SetAlwaysOnTop(bool on_top) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698