Chromium Code Reviews| Index: ui/views/focus/focus_manager.cc |
| diff --git a/ui/views/focus/focus_manager.cc b/ui/views/focus/focus_manager.cc |
| index bd6b0dc19fe4749a958afe41f8c49dd158ed446a..c65fa84199112981a7331fa27060bd10966c13a9 100644 |
| --- a/ui/views/focus/focus_manager.cc |
| +++ b/ui/views/focus/focus_manager.cc |
| @@ -517,7 +517,10 @@ void FocusManager::ViewRemoved(View* removed) { |
| // clear the focus. However, it's not safe to call ClearFocus() |
| // (and in turn ClearNativeFocus()) here because ViewRemoved() can |
| // be called while the top level widget is being destroyed. |
| - if (focused_view_ && removed->Contains(focused_view_)) |
| + if (!focused_view_) |
|
sky
2016/06/09 17:23:14
Contains handles null correctly, so you shouldn't
krasin
2016/06/09 17:46:11
I need an early exit, if ViewRemoved is called wit
sky
2016/06/09 18:06:00
Not sure I follow. If focused_view_ is null Contai
krasin
2016/06/09 18:13:06
Consider the case, when removed == NULL. We have t
sky
2016/06/09 22:34:24
removed == null is an error in the call sites and
krasin
2016/06/09 23:10:57
I have tried that. Multiple (almost all) tests are
|
| + return; |
| + DCHECK(removed != NULL); |
|
sky
2016/06/09 17:23:14
DCHECK(removed);
krasin
2016/06/09 17:46:11
Done.
|
| + if (removed->Contains(focused_view_)) |
| SetFocusedView(NULL); |
| } |