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

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

Issue 10910034: Attempt 2 at: Fixes crash that occured because NativeViewHostAura::Detach was not (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: da fix Created 8 years, 4 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 | « ui/views/controls/native/native_view_host_win.cc ('k') | 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 7c6a9b57b07ccc5ae5b358ee7b4e7d27fec236f8..98ba00e61802e33cf7eb09c5a835e491d291138d 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -546,8 +546,11 @@ bool NativeWidgetAura::IsVisible() const {
}
void NativeWidgetAura::Activate() {
- aura::client::GetActivationClient(window_->GetRootWindow())->ActivateWindow(
- window_);
+ // We don't necessarily have a root window yet. This can happen with
+ // constrained windows.
+ if (window_->GetRootWindow())
+ aura::client::GetActivationClient(window_->GetRootWindow())->ActivateWindow(
+ window_);
}
void NativeWidgetAura::Deactivate() {
@@ -1002,7 +1005,7 @@ void NativeWidgetPrivate::GetAllChildWidgets(gfx::NativeView native_view,
// Code expects widget for |native_view| to be added to |children|.
NativeWidgetAura* native_widget = static_cast<NativeWidgetAura*>(
GetNativeWidgetForNativeView(native_view));
- if (native_widget->GetWidget())
+ if (native_widget && native_widget->GetWidget())
children->insert(native_widget->GetWidget());
}
« no previous file with comments | « ui/views/controls/native/native_view_host_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698