Chromium Code Reviews| Index: ui/views/corewm/focus_controller.cc |
| diff --git a/ui/views/corewm/focus_controller.cc b/ui/views/corewm/focus_controller.cc |
| index eaab15101820708b88242137c2ffe4cd836e7915..90500d58f61101e6e265f30848bddeeb85dee97e 100644 |
| --- a/ui/views/corewm/focus_controller.cc |
| +++ b/ui/views/corewm/focus_controller.cc |
| @@ -253,7 +253,14 @@ void FocusController::OnWindowHierarchyChanged( |
| void FocusController::SetFocusedWindow(aura::Window* window) { |
| if (updating_focus_ || window == focused_window_) |
| return; |
| - DCHECK(rules_->CanFocusWindow(window)); |
| + |
| + // When a modal dialog appears, SetFocusedWindow gets called by |
| + // ClearNativeFocus for the previously active window as it is deactivated. In |
| + // this case, CanFocusWindow returns false and this method has no further |
| + // work to do. |
| + if (!rules_->CanFocusWindow(window)) |
|
Ben Goodger (Google)
2013/04/25 17:19:28
I'm not happy with this. I've made it thus far tha
robertshield
2013/04/26 18:40:42
I reverted this bit and instead now perform a chec
|
| + return; |
| + |
| if (window) |
| DCHECK_EQ(window, rules_->GetFocusableWindow(window)); |