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/session/session_state_delegate.h" |
9 #include "ash/common/shell_observer.h" | 9 #include "ash/common/shell_observer.h" |
10 #include "ash/common/wm/mru_window_tracker.h" | 10 #include "ash/common/wm/mru_window_tracker.h" |
11 #include "ash/common/wm_activation_observer.h" | 11 #include "ash/common/wm_activation_observer.h" |
12 #include "ash/common/wm_display_observer.h" | 12 #include "ash/common/wm_display_observer.h" |
13 #include "ash/common/wm_shell_common.h" | 13 #include "ash/common/wm_shell_common.h" |
14 #include "ash/display/window_tree_host_manager.h" | 14 #include "ash/display/window_tree_host_manager.h" |
15 #include "ash/shell.h" | 15 #include "ash/shell.h" |
16 #include "ash/shell_delegate.h" | 16 #include "ash/shell_delegate.h" |
17 #include "ash/wm/drag_window_resizer.h" | 17 #include "ash/wm/drag_window_resizer.h" |
18 #include "ash/wm/overview/window_selector_controller.h" | 18 #include "ash/wm/overview/window_selector_controller.h" |
| 19 #include "ash/wm/screen_pinning_controller.h" |
19 #include "ash/wm/window_util.h" | 20 #include "ash/wm/window_util.h" |
20 #include "base/memory/ptr_util.h" | 21 #include "base/memory/ptr_util.h" |
21 #include "ui/aura/client/focus_client.h" | 22 #include "ui/aura/client/focus_client.h" |
22 #include "ui/wm/public/activation_client.h" | 23 #include "ui/wm/public/activation_client.h" |
23 | 24 |
24 namespace ash { | 25 namespace ash { |
25 | 26 |
26 WmShellAura::WmShellAura(WmShellCommon* wm_shell_common) | 27 WmShellAura::WmShellAura(WmShellCommon* wm_shell_common) |
27 : wm_shell_common_(wm_shell_common) { | 28 : wm_shell_common_(wm_shell_common) { |
28 WmShell::Set(this); | 29 WmShell::Set(this); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 73 |
73 WmWindow* WmShellAura::GetRootWindowForNewWindows() { | 74 WmWindow* WmShellAura::GetRootWindowForNewWindows() { |
74 return WmWindowAura::Get(Shell::GetTargetRootWindow()); | 75 return WmWindowAura::Get(Shell::GetTargetRootWindow()); |
75 } | 76 } |
76 | 77 |
77 | 78 |
78 bool WmShellAura::IsForceMaximizeOnFirstRun() { | 79 bool WmShellAura::IsForceMaximizeOnFirstRun() { |
79 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun(); | 80 return Shell::GetInstance()->delegate()->IsForceMaximizeOnFirstRun(); |
80 } | 81 } |
81 | 82 |
| 83 bool WmShellAura::IsPinned() { |
| 84 return Shell::GetInstance()->screen_pinning_controller()->IsPinned(); |
| 85 } |
| 86 |
| 87 void WmShellAura::SetPinnedWindow(WmWindow* window) { |
| 88 return Shell::GetInstance()->screen_pinning_controller()->SetPinnedWindow( |
| 89 window); |
| 90 } |
| 91 |
82 bool WmShellAura::CanShowWindowForUser(WmWindow* window) { | 92 bool WmShellAura::CanShowWindowForUser(WmWindow* window) { |
83 return Shell::GetInstance()->delegate()->CanShowWindowForUser(window); | 93 return Shell::GetInstance()->delegate()->CanShowWindowForUser(window); |
84 } | 94 } |
85 | 95 |
86 void WmShellAura::LockCursor() { | 96 void WmShellAura::LockCursor() { |
87 Shell::GetInstance()->cursor_manager()->LockCursor(); | 97 Shell::GetInstance()->cursor_manager()->LockCursor(); |
88 } | 98 } |
89 | 99 |
90 void WmShellAura::UnlockCursor() { | 100 void WmShellAura::UnlockCursor() { |
91 Shell::GetInstance()->cursor_manager()->UnlockCursor(); | 101 Shell::GetInstance()->cursor_manager()->UnlockCursor(); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 177 } |
168 | 178 |
169 void WmShellAura::AddShellObserver(ShellObserver* observer) { | 179 void WmShellAura::AddShellObserver(ShellObserver* observer) { |
170 wm_shell_common_->AddShellObserver(observer); | 180 wm_shell_common_->AddShellObserver(observer); |
171 } | 181 } |
172 | 182 |
173 void WmShellAura::RemoveShellObserver(ShellObserver* observer) { | 183 void WmShellAura::RemoveShellObserver(ShellObserver* observer) { |
174 wm_shell_common_->RemoveShellObserver(observer); | 184 wm_shell_common_->RemoveShellObserver(observer); |
175 } | 185 } |
176 | 186 |
177 void WmShellAura::NotifyPinnedStateChanged(WmWindow* pinned_window) { | |
178 wm_shell_common_->NotifyPinnedStateChanged(pinned_window); | |
179 } | |
180 | |
181 void WmShellAura::OnWindowActivated( | 187 void WmShellAura::OnWindowActivated( |
182 aura::client::ActivationChangeObserver::ActivationReason reason, | 188 aura::client::ActivationChangeObserver::ActivationReason reason, |
183 aura::Window* gained_active, | 189 aura::Window* gained_active, |
184 aura::Window* lost_active) { | 190 aura::Window* lost_active) { |
185 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_, | 191 FOR_EACH_OBSERVER(WmActivationObserver, activation_observers_, |
186 OnWindowActivated(WmWindowAura::Get(gained_active), | 192 OnWindowActivated(WmWindowAura::Get(gained_active), |
187 WmWindowAura::Get(lost_active))); | 193 WmWindowAura::Get(lost_active))); |
188 } | 194 } |
189 | 195 |
190 void WmShellAura::OnAttemptToReactivateWindow(aura::Window* request_active, | 196 void WmShellAura::OnAttemptToReactivateWindow(aura::Window* request_active, |
191 aura::Window* actual_active) { | 197 aura::Window* actual_active) { |
192 FOR_EACH_OBSERVER( | 198 FOR_EACH_OBSERVER( |
193 WmActivationObserver, activation_observers_, | 199 WmActivationObserver, activation_observers_, |
194 OnAttemptToReactivateWindow(WmWindowAura::Get(request_active), | 200 OnAttemptToReactivateWindow(WmWindowAura::Get(request_active), |
195 WmWindowAura::Get(actual_active))); | 201 WmWindowAura::Get(actual_active))); |
196 } | 202 } |
197 | 203 |
198 void WmShellAura::OnDisplayConfigurationChanging() { | 204 void WmShellAura::OnDisplayConfigurationChanging() { |
199 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, | 205 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, |
200 OnDisplayConfigurationChanging()); | 206 OnDisplayConfigurationChanging()); |
201 } | 207 } |
202 | 208 |
203 void WmShellAura::OnDisplayConfigurationChanged() { | 209 void WmShellAura::OnDisplayConfigurationChanged() { |
204 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, | 210 FOR_EACH_OBSERVER(WmDisplayObserver, display_observers_, |
205 OnDisplayConfigurationChanged()); | 211 OnDisplayConfigurationChanged()); |
206 } | 212 } |
207 | 213 |
208 } // namespace ash | 214 } // namespace ash |
OLD | NEW |