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

Unified Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 873513002: [Views] Make MenuButton track its desired state while pressed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « ui/views/controls/button/menu_button_unittest.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/desktop_aura/desktop_native_widget_aura.cc
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index 88c60906b7268d02bffd85fdb683ef05c9bca77a..2e1acca58af6e8eb3d3c65d97970986fb5d14cbc 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -870,7 +870,10 @@ void DesktopNativeWidgetAura::SetCursor(gfx::NativeCursor cursor) {
}
bool DesktopNativeWidgetAura::IsMouseEventsEnabled() const {
- if (!content_window_)
+ // We explicitly check |host_| here because it can be null during the process
+ // of widget shutdown (even if |content_window_| is not), and must be valid to
+ // determine if mouse events are enabled.
+ if (!content_window_ || !host_)
return false;
aura::client::CursorClient* cursor_client =
aura::client::GetCursorClient(host_->window());
« no previous file with comments | « ui/views/controls/button/menu_button_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698