summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--views/focus/focus_manager.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/views/focus/focus_manager.cc b/views/focus/focus_manager.cc
index 3751ace..2007ff1 100644
--- a/views/focus/focus_manager.cc
+++ b/views/focus/focus_manager.cc
@@ -313,7 +313,11 @@ void FocusManager::SetFocusedViewWithReason(
if (view) {
view->SchedulePaint();
view->Focus();
- view->DidGainFocus();
+ if (view == focused_view_) {
+ // Only tell the view it is focused if it's still our focused view. It's
+ // possible for Focus to remove/delete the view.
+ view->DidGainFocus();
+ }
}
}