| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/aura/wm_shell_aura.h" | 5 #include "ash/aura/wm_shell_aura.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/wm/mru_window_tracker.h" | 9 #include "ash/common/wm/mru_window_tracker.h" |
| 9 #include "ash/common/wm_activation_observer.h" | 10 #include "ash/common/wm_activation_observer.h" |
| 10 #include "ash/common/wm_display_observer.h" | 11 #include "ash/common/wm_display_observer.h" |
| 11 #include "ash/common/wm_overview_mode_observer.h" | 12 #include "ash/common/wm_overview_mode_observer.h" |
| 12 #include "ash/display/window_tree_host_manager.h" | 13 #include "ash/display/window_tree_host_manager.h" |
| 13 #include "ash/session/session_state_delegate.h" | |
| 14 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 15 #include "ash/shell_delegate.h" | 15 #include "ash/shell_delegate.h" |
| 16 #include "ash/wm/drag_window_resizer.h" | 16 #include "ash/wm/drag_window_resizer.h" |
| 17 #include "ash/wm/overview/window_selector_controller.h" | 17 #include "ash/wm/overview/window_selector_controller.h" |
| 18 #include "ash/wm/window_util.h" | 18 #include "ash/wm/window_util.h" |
| 19 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
| 20 #include "ui/aura/client/focus_client.h" | 20 #include "ui/aura/client/focus_client.h" |
| 21 #include "ui/wm/public/activation_client.h" | 21 #include "ui/wm/public/activation_client.h" |
| 22 | 22 |
| 23 namespace ash { | 23 namespace ash { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // http://crbug.com/617789. | 80 // http://crbug.com/617789. |
| 81 return Shell::GetInstance() | 81 return Shell::GetInstance() |
| 82 ->mru_window_tracker() | 82 ->mru_window_tracker() |
| 83 ->BuildWindowListIgnoreModal(); | 83 ->BuildWindowListIgnoreModal(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool WmShellAura::IsForceMaximizeOnFirstRun() { | 86 bool WmShellAura::IsForceMaximizeOnFirstRun() { |
| 87 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun(); | 87 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 bool WmShellAura::IsUserSessionBlocked() { | |
| 91 return Shell::GetInstance()->session_state_delegate()->IsUserSessionBlocked(); | |
| 92 } | |
| 93 | |
| 94 bool WmShellAura::IsScreenLocked() { | |
| 95 return Shell::GetInstance()->session_state_delegate()->IsScreenLocked(); | |
| 96 } | |
| 97 | |
| 98 bool WmShellAura::CanShowWindowForUser(WmWindow* window) { | 90 bool WmShellAura::CanShowWindowForUser(WmWindow* window) { |
| 99 return Shell::GetInstance()->delegate()->CanShowWindowForUser( | 91 return Shell::GetInstance()->delegate()->CanShowWindowForUser( |
| 100 WmWindowAura::GetAuraWindow(window)); | 92 WmWindowAura::GetAuraWindow(window)); |
| 101 } | 93 } |
| 102 | 94 |
| 103 void WmShellAura::LockCursor() { | 95 void WmShellAura::LockCursor() { |
| 104 Shell::GetInstance()->cursor_manager()->LockCursor(); | 96 Shell::GetInstance()->cursor_manager()->LockCursor(); |
| 105 } | 97 } |
| 106 | 98 |
| 107 void WmShellAura::UnlockCursor() { | 99 void WmShellAura::UnlockCursor() { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 134 window_selector_controller->IsSelecting(); | 126 window_selector_controller->IsSelecting(); |
| 135 } | 127 } |
| 136 | 128 |
| 137 bool WmShellAura::IsOverviewModeRestoringMinimizedWindows() { | 129 bool WmShellAura::IsOverviewModeRestoringMinimizedWindows() { |
| 138 WindowSelectorController* window_selector_controller = | 130 WindowSelectorController* window_selector_controller = |
| 139 Shell::GetInstance()->window_selector_controller(); | 131 Shell::GetInstance()->window_selector_controller(); |
| 140 return window_selector_controller && | 132 return window_selector_controller && |
| 141 window_selector_controller->IsRestoringMinimizedWindows(); | 133 window_selector_controller->IsRestoringMinimizedWindows(); |
| 142 } | 134 } |
| 143 | 135 |
| 136 SessionStateDelegate* WmShellAura::GetSessionStateDelegate() { |
| 137 return Shell::GetInstance()->session_state_delegate(); |
| 138 } |
| 139 |
| 144 void WmShellAura::AddActivationObserver(WmActivationObserver* observer) { | 140 void WmShellAura::AddActivationObserver(WmActivationObserver* observer) { |
| 145 if (!added_activation_observer_) { | 141 if (!added_activation_observer_) { |
| 146 added_activation_observer_ = true; | 142 added_activation_observer_ = true; |
| 147 Shell::GetInstance()->activation_client()->AddObserver(this); | 143 Shell::GetInstance()->activation_client()->AddObserver(this); |
| 148 } | 144 } |
| 149 activation_observers_.AddObserver(observer); | 145 activation_observers_.AddObserver(observer); |
| 150 } | 146 } |
| 151 | 147 |
| 152 void WmShellAura::RemoveActivationObserver(WmActivationObserver* observer) { | 148 void WmShellAura::RemoveActivationObserver(WmActivationObserver* observer) { |
| 153 activation_observers_.RemoveObserver(observer); | 149 activation_observers_.RemoveObserver(observer); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, | 195 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, |
| 200 OnDisplayConfigurationChanged()); | 196 OnDisplayConfigurationChanged()); |
| 201 } | 197 } |
| 202 | 198 |
| 203 void WmShellAura::OnOverviewModeEnded() { | 199 void WmShellAura::OnOverviewModeEnded() { |
| 204 FOR_EACH_OBSERVER(WmOverviewModeObserver, overview_mode_observers_, | 200 FOR_EACH_OBSERVER(WmOverviewModeObserver, overview_mode_observers_, |
| 205 OnOverviewModeEnded()); | 201 OnOverviewModeEnded()); |
| 206 } | 202 } |
| 207 | 203 |
| 208 } // namespace ash | 204 } // namespace ash |
| OLD | NEW |