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/wm/core/focus_controller.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "ui/aura/client/activation_change_observer.h" | 8 #include "ui/aura/client/activation_change_observer.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/capture_client.h" | 10 #include "ui/aura/client/capture_client.h" |
11 #include "ui/aura/client/focus_change_observer.h" | 11 #include "ui/aura/client/focus_change_observer.h" |
12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
13 #include "ui/aura/window_tracker.h" | 13 #include "ui/aura/window_tracker.h" |
14 #include "ui/events/event.h" | 14 #include "ui/events/event.h" |
15 #include "ui/views/corewm/focus_rules.h" | 15 #include "ui/wm/core/focus_rules.h" |
16 #include "ui/views/corewm/window_util.h" | 16 #include "ui/wm/core/window_util.h" |
17 | 17 |
18 namespace views { | 18 namespace views { |
19 namespace corewm { | 19 namespace corewm { |
20 namespace { | 20 namespace { |
21 | 21 |
22 // When a modal window is activated, we bring its entire transient parent chain | 22 // When a modal window is activated, we bring its entire transient parent chain |
23 // to the front. This function must be called before the modal transient is | 23 // to the front. This function must be called before the modal transient is |
24 // stacked at the top to ensure correct stacking order. | 24 // stacked at the top to ensure correct stacking order. |
25 void StackTransientParentsBelowModalWindow(aura::Window* window) { | 25 void StackTransientParentsBelowModalWindow(aura::Window* window) { |
26 if (window->GetProperty(aura::client::kModalKey) != ui::MODAL_TYPE_WINDOW) | 26 if (window->GetProperty(aura::client::kModalKey) != ui::MODAL_TYPE_WINDOW) |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 void FocusController::WindowFocusedFromInputEvent(aura::Window* window) { | 370 void FocusController::WindowFocusedFromInputEvent(aura::Window* window) { |
371 // Only focus |window| if it or any of its parents can be focused. Otherwise | 371 // Only focus |window| if it or any of its parents can be focused. Otherwise |
372 // FocusWindow() will focus the topmost window, which may not be the | 372 // FocusWindow() will focus the topmost window, which may not be the |
373 // currently focused one. | 373 // currently focused one. |
374 if (rules_->CanFocusWindow(GetToplevelWindow(window))) | 374 if (rules_->CanFocusWindow(GetToplevelWindow(window))) |
375 FocusWindow(window); | 375 FocusWindow(window); |
376 } | 376 } |
377 | 377 |
378 } // namespace corewm | 378 } // namespace corewm |
379 } // namespace views | 379 } // namespace views |
OLD | NEW |