| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/corewm/focus_controller.h" | 5 #include "ui/views/corewm/focus_controller.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
| 9 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
| 10 #include "ui/views/corewm/focus_change_event.h" | 10 #include "ui/views/corewm/focus_change_event.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 int changing_event_type, | 33 int changing_event_type, |
| 34 int changed_event_type, | 34 int changed_event_type, |
| 35 aura::Window** state, | 35 aura::Window** state, |
| 36 aura::Window* new_state, | 36 aura::Window* new_state, |
| 37 bool restack, | 37 bool restack, |
| 38 ui::EventTarget** event_dispatch_target) { | 38 ui::EventTarget** event_dispatch_target) { |
| 39 int result = ui::ER_UNHANDLED; | 39 int result = ui::ER_UNHANDLED; |
| 40 { | 40 { |
| 41 base::AutoReset<ui::EventTarget*> reset(event_dispatch_target, *state); | 41 base::AutoReset<ui::EventTarget*> reset(event_dispatch_target, *state); |
| 42 FocusChangeEvent changing_event(changing_event_type); | 42 FocusChangeEvent changing_event(changing_event_type); |
| 43 result = dispatcher->ProcessEvent(*state, &changing_event); | 43 dispatcher->ProcessEvent(*state, &changing_event); |
| 44 result = changing_event.result(); |
| 44 } | 45 } |
| 45 DCHECK(!(result & ui::ER_CONSUMED)) | 46 DCHECK(!(result & ui::ER_CONSUMED)) |
| 46 << "Focus and Activation events cannot be consumed"; | 47 << "Focus and Activation events cannot be consumed"; |
| 47 | 48 |
| 48 *state = new_state; | 49 *state = new_state; |
| 49 | 50 |
| 50 if (restack && new_state) { | 51 if (restack && new_state) { |
| 51 StackTransientParentsBelowModalWindow(new_state); | 52 StackTransientParentsBelowModalWindow(new_state); |
| 52 new_state->parent()->StackChildAtTop(new_state); | 53 new_state->parent()->StackChildAtTop(new_state); |
| 53 } | 54 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 SetFocusedWindow(rules_->GetNextFocusableWindow(window)); | 241 SetFocusedWindow(rules_->GetNextFocusableWindow(window)); |
| 241 } | 242 } |
| 242 } | 243 } |
| 243 | 244 |
| 244 void FocusController::WindowFocusedFromInputEvent(aura::Window* window) { | 245 void FocusController::WindowFocusedFromInputEvent(aura::Window* window) { |
| 245 FocusWindow(window); | 246 FocusWindow(window); |
| 246 } | 247 } |
| 247 | 248 |
| 248 } // namespace corewm | 249 } // namespace corewm |
| 249 } // namespace views | 250 } // namespace views |
| OLD | NEW |