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 "ash/wm/activation_controller.h" | 5 #include "ash/wm/activation_controller.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/activation_controller_delegate.h" | 10 #include "ash/wm/activation_controller_delegate.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 // Returns true if |window| can be activated or deactivated. | 105 // Returns true if |window| can be activated or deactivated. |
106 // A window manager typically defines some notion of "top level window" that | 106 // A window manager typically defines some notion of "top level window" that |
107 // supports activation/deactivation. | 107 // supports activation/deactivation. |
108 bool CanActivateWindowWithEvent(aura::Window* window, | 108 bool CanActivateWindowWithEvent(aura::Window* window, |
109 const ui::Event* event, | 109 const ui::Event* event, |
110 ActivateVisibilityType visibility_type) { | 110 ActivateVisibilityType visibility_type) { |
111 return window && | 111 return window && |
112 VisibilityMatches(window, visibility_type) && | 112 VisibilityMatches(window, visibility_type) && |
113 (!aura::client::GetActivationDelegate(window) || | 113 (!aura::client::GetActivationDelegate(window) || |
114 aura::client::GetActivationDelegate(window)->ShouldActivate()) && | 114 aura::client::GetActivationDelegate(window)->ShouldActivate(event)) && |
115 SupportsChildActivation(window->parent()) && | 115 SupportsChildActivation(window->parent()) && |
116 (BelongsToContainerWithEqualOrGreaterId( | 116 (BelongsToContainerWithEqualOrGreaterId( |
117 window, kShellWindowId_SystemModalContainer) || | 117 window, kShellWindowId_SystemModalContainer) || |
118 !Shell::GetInstance()->IsSystemModalWindowOpen()); | 118 !Shell::GetInstance()->IsSystemModalWindowOpen()); |
119 } | 119 } |
120 | 120 |
121 // When a modal window is activated, we bring its entire transient parent chain | 121 // When a modal window is activated, we bring its entire transient parent chain |
122 // to the front. This function must be called before the modal transient is | 122 // to the front. This function must be called before the modal transient is |
123 // stacked at the top to ensure correct stacking order. | 123 // stacked at the top to ensure correct stacking order. |
124 void StackTransientParentsBelowModalWindow(aura::Window* window) { | 124 void StackTransientParentsBelowModalWindow(aura::Window* window) { |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 aura::Window* window = static_cast<aura::Window*>(event->target()); | 421 aura::Window* window = static_cast<aura::Window*>(event->target()); |
422 window = delegate_->WillFocusWindow(window); | 422 window = delegate_->WillFocusWindow(window); |
423 if (GetActiveWindow() != window) { | 423 if (GetActiveWindow() != window) { |
424 aura::client::GetFocusClient(window)->FocusWindow( | 424 aura::client::GetFocusClient(window)->FocusWindow( |
425 FindFocusableWindowFor(window), event); | 425 FindFocusableWindowFor(window), event); |
426 } | 426 } |
427 } | 427 } |
428 | 428 |
429 } // namespace internal | 429 } // namespace internal |
430 } // namespace ash | 430 } // namespace ash |
OLD | NEW |