Commit 8c0e82ad authored by sky@chromium.org's avatar sky@chromium.org

Fixes crah in NativeWidgetAura::IsActive()

The crash happens if when the HWND is destroyed someone asks if a
child NativeWidgetAura is Active. In particular during this code path
we've gone through ~RootWindow and are in ~Window. When this happens
GetRootWindow() uses Window's implementation, which returns NULL and
we crash.

BUG=264855
TEST=none
R=ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23904005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222096 0039d316-1c4b-4281-b951-d872f2087c98
parent f17c00f0
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment