OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/maximize_mode/maximize_mode_window_manager.h" | 5 #include "ash/wm/tablet_mode/tablet_mode_window_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "ash/shell_port.h" | 12 #include "ash/shell_port.h" |
13 #include "ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.h" | |
14 #include "ash/wm/maximize_mode/maximize_mode_event_handler.h" | |
15 #include "ash/wm/maximize_mode/maximize_mode_window_state.h" | |
16 #include "ash/wm/mru_window_tracker.h" | 13 #include "ash/wm/mru_window_tracker.h" |
17 #include "ash/wm/overview/window_selector_controller.h" | 14 #include "ash/wm/overview/window_selector_controller.h" |
| 15 #include "ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h" |
| 16 #include "ash/wm/tablet_mode/tablet_mode_event_handler.h" |
| 17 #include "ash/wm/tablet_mode/tablet_mode_window_state.h" |
18 #include "ash/wm/window_state.h" | 18 #include "ash/wm/window_state.h" |
19 #include "ash/wm/wm_event.h" | 19 #include "ash/wm/wm_event.h" |
20 #include "ash/wm/workspace_controller.h" | 20 #include "ash/wm/workspace_controller.h" |
21 #include "base/command_line.h" | 21 #include "base/command_line.h" |
22 #include "base/memory/ptr_util.h" | 22 #include "base/memory/ptr_util.h" |
23 #include "base/stl_util.h" | 23 #include "base/stl_util.h" |
24 #include "ui/aura/client/aura_constants.h" | 24 #include "ui/aura/client/aura_constants.h" |
25 #include "ui/display/screen.h" | 25 #include "ui/display/screen.h" |
26 | 26 |
27 namespace ash { | 27 namespace ash { |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 // Exits overview mode if it is currently active. | 31 // Exits overview mode if it is currently active. |
32 void CancelOverview() { | 32 void CancelOverview() { |
33 WindowSelectorController* controller = | 33 WindowSelectorController* controller = |
34 Shell::Get()->window_selector_controller(); | 34 Shell::Get()->window_selector_controller(); |
35 if (controller->IsSelecting()) | 35 if (controller->IsSelecting()) |
36 controller->OnSelectionEnded(); | 36 controller->OnSelectionEnded(); |
37 } | 37 } |
38 | 38 |
39 } // namespace | 39 } // namespace |
40 | 40 |
41 MaximizeModeWindowManager::~MaximizeModeWindowManager() { | 41 TabletModeWindowManager::~TabletModeWindowManager() { |
42 // Overview mode needs to be ended before exiting maximize mode to prevent | 42 // Overview mode needs to be ended before exiting tablet mode to prevent |
43 // transforming windows which are currently in | 43 // transforming windows which are currently in |
44 // overview: http://crbug.com/366605 | 44 // overview: http://crbug.com/366605 |
45 CancelOverview(); | 45 CancelOverview(); |
46 for (aura::Window* window : added_windows_) | 46 for (aura::Window* window : added_windows_) |
47 window->RemoveObserver(this); | 47 window->RemoveObserver(this); |
48 added_windows_.clear(); | 48 added_windows_.clear(); |
49 Shell::Get()->RemoveShellObserver(this); | 49 Shell::Get()->RemoveShellObserver(this); |
50 display::Screen::GetScreen()->RemoveObserver(this); | 50 display::Screen::GetScreen()->RemoveObserver(this); |
51 EnableBackdropBehindTopWindowOnEachDisplay(false); | 51 EnableBackdropBehindTopWindowOnEachDisplay(false); |
52 RemoveWindowCreationObservers(); | 52 RemoveWindowCreationObservers(); |
53 RestoreAllWindows(); | 53 RestoreAllWindows(); |
54 } | 54 } |
55 | 55 |
56 int MaximizeModeWindowManager::GetNumberOfManagedWindows() { | 56 int TabletModeWindowManager::GetNumberOfManagedWindows() { |
57 return window_state_map_.size(); | 57 return window_state_map_.size(); |
58 } | 58 } |
59 | 59 |
60 void MaximizeModeWindowManager::AddWindow(aura::Window* window) { | 60 void TabletModeWindowManager::AddWindow(aura::Window* window) { |
61 // Only add the window if it is a direct dependent of a container window | 61 // Only add the window if it is a direct dependent of a container window |
62 // and not yet tracked. | 62 // and not yet tracked. |
63 if (!ShouldHandleWindow(window) || | 63 if (!ShouldHandleWindow(window) || |
64 base::ContainsKey(window_state_map_, window) || | 64 base::ContainsKey(window_state_map_, window) || |
65 !IsContainerWindow(window->parent())) { | 65 !IsContainerWindow(window->parent())) { |
66 return; | 66 return; |
67 } | 67 } |
68 | 68 |
69 MaximizeAndTrackWindow(window); | 69 MaximizeAndTrackWindow(window); |
70 } | 70 } |
71 | 71 |
72 void MaximizeModeWindowManager::WindowStateDestroyed(aura::Window* window) { | 72 void TabletModeWindowManager::WindowStateDestroyed(aura::Window* window) { |
73 // At this time ForgetWindow() should already have been called. If not, | 73 // At this time ForgetWindow() should already have been called. If not, |
74 // someone else must have replaced the "window manager's state object". | 74 // someone else must have replaced the "window manager's state object". |
75 DCHECK(!window->HasObserver(this)); | 75 DCHECK(!window->HasObserver(this)); |
76 | 76 |
77 auto it = window_state_map_.find(window); | 77 auto it = window_state_map_.find(window); |
78 DCHECK(it != window_state_map_.end()); | 78 DCHECK(it != window_state_map_.end()); |
79 window_state_map_.erase(it); | 79 window_state_map_.erase(it); |
80 } | 80 } |
81 | 81 |
82 void MaximizeModeWindowManager::OnOverviewModeStarting() { | 82 void TabletModeWindowManager::OnOverviewModeStarting() { |
83 SetDeferBoundsUpdates(true); | 83 SetDeferBoundsUpdates(true); |
84 } | 84 } |
85 | 85 |
86 void MaximizeModeWindowManager::OnOverviewModeEnded() { | 86 void TabletModeWindowManager::OnOverviewModeEnded() { |
87 SetDeferBoundsUpdates(false); | 87 SetDeferBoundsUpdates(false); |
88 } | 88 } |
89 | 89 |
90 void MaximizeModeWindowManager::OnWindowDestroying(aura::Window* window) { | 90 void TabletModeWindowManager::OnWindowDestroying(aura::Window* window) { |
91 if (IsContainerWindow(window)) { | 91 if (IsContainerWindow(window)) { |
92 // container window can be removed on display destruction. | 92 // container window can be removed on display destruction. |
93 window->RemoveObserver(this); | 93 window->RemoveObserver(this); |
94 observed_container_windows_.erase(window); | 94 observed_container_windows_.erase(window); |
95 } else if (base::ContainsValue(added_windows_, window)) { | 95 } else if (base::ContainsValue(added_windows_, window)) { |
96 // Added window was destroyed before being shown. | 96 // Added window was destroyed before being shown. |
97 added_windows_.erase(window); | 97 added_windows_.erase(window); |
98 window->RemoveObserver(this); | 98 window->RemoveObserver(this); |
99 } else { | 99 } else { |
100 // If a known window gets destroyed we need to remove all knowledge about | 100 // If a known window gets destroyed we need to remove all knowledge about |
101 // it. | 101 // it. |
102 ForgetWindow(window); | 102 ForgetWindow(window); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 void MaximizeModeWindowManager::OnWindowHierarchyChanged( | 106 void TabletModeWindowManager::OnWindowHierarchyChanged( |
107 const HierarchyChangeParams& params) { | 107 const HierarchyChangeParams& params) { |
108 // A window can get removed and then re-added by a drag and drop operation. | 108 // A window can get removed and then re-added by a drag and drop operation. |
109 if (params.new_parent && IsContainerWindow(params.new_parent) && | 109 if (params.new_parent && IsContainerWindow(params.new_parent) && |
110 !base::ContainsKey(window_state_map_, params.target)) { | 110 !base::ContainsKey(window_state_map_, params.target)) { |
111 // Don't register the window if the window is invisible. Instead, | 111 // Don't register the window if the window is invisible. Instead, |
112 // wait until it becomes visible because the client may update the | 112 // wait until it becomes visible because the client may update the |
113 // flag to control if the window should be added. | 113 // flag to control if the window should be added. |
114 if (!params.target->IsVisible()) { | 114 if (!params.target->IsVisible()) { |
115 if (!base::ContainsValue(added_windows_, params.target)) { | 115 if (!base::ContainsValue(added_windows_, params.target)) { |
116 added_windows_.insert(params.target); | 116 added_windows_.insert(params.target); |
117 params.target->AddObserver(this); | 117 params.target->AddObserver(this); |
118 } | 118 } |
119 return; | 119 return; |
120 } | 120 } |
121 MaximizeAndTrackWindow(params.target); | 121 MaximizeAndTrackWindow(params.target); |
122 // When the state got added, the "WM_EVENT_ADDED_TO_WORKSPACE" event got | 122 // When the state got added, the "WM_EVENT_ADDED_TO_WORKSPACE" event got |
123 // already sent and we have to notify our state again. | 123 // already sent and we have to notify our state again. |
124 if (base::ContainsKey(window_state_map_, params.target)) { | 124 if (base::ContainsKey(window_state_map_, params.target)) { |
125 wm::WMEvent event(wm::WM_EVENT_ADDED_TO_WORKSPACE); | 125 wm::WMEvent event(wm::WM_EVENT_ADDED_TO_WORKSPACE); |
126 wm::GetWindowState(params.target)->OnWMEvent(&event); | 126 wm::GetWindowState(params.target)->OnWMEvent(&event); |
127 } | 127 } |
128 } | 128 } |
129 } | 129 } |
130 | 130 |
131 void MaximizeModeWindowManager::OnWindowPropertyChanged(aura::Window* window, | 131 void TabletModeWindowManager::OnWindowPropertyChanged(aura::Window* window, |
132 const void* key, | 132 const void* key, |
133 intptr_t old) { | 133 intptr_t old) { |
134 // Stop managing |window| if the always-on-top property is added. | 134 // Stop managing |window| if the always-on-top property is added. |
135 if (key == aura::client::kAlwaysOnTopKey && | 135 if (key == aura::client::kAlwaysOnTopKey && |
136 window->GetProperty(aura::client::kAlwaysOnTopKey)) { | 136 window->GetProperty(aura::client::kAlwaysOnTopKey)) { |
137 ForgetWindow(window); | 137 ForgetWindow(window); |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 void MaximizeModeWindowManager::OnWindowBoundsChanged( | 141 void TabletModeWindowManager::OnWindowBoundsChanged( |
142 aura::Window* window, | 142 aura::Window* window, |
143 const gfx::Rect& old_bounds, | 143 const gfx::Rect& old_bounds, |
144 const gfx::Rect& new_bounds) { | 144 const gfx::Rect& new_bounds) { |
145 if (!IsContainerWindow(window)) | 145 if (!IsContainerWindow(window)) |
146 return; | 146 return; |
147 // Reposition all non maximizeable windows. | 147 // Reposition all non maximizeable windows. |
148 for (auto& pair : window_state_map_) | 148 for (auto& pair : window_state_map_) |
149 pair.second->UpdateWindowPosition(wm::GetWindowState(pair.first)); | 149 pair.second->UpdateWindowPosition(wm::GetWindowState(pair.first)); |
150 } | 150 } |
151 | 151 |
152 void MaximizeModeWindowManager::OnWindowVisibilityChanged(aura::Window* window, | 152 void TabletModeWindowManager::OnWindowVisibilityChanged(aura::Window* window, |
153 bool visible) { | 153 bool visible) { |
154 // Skip if it's already managed. | 154 // Skip if it's already managed. |
155 if (base::ContainsKey(window_state_map_, window)) | 155 if (base::ContainsKey(window_state_map_, window)) |
156 return; | 156 return; |
157 | 157 |
158 if (IsContainerWindow(window->parent()) && | 158 if (IsContainerWindow(window->parent()) && |
159 base::ContainsValue(added_windows_, window) && visible) { | 159 base::ContainsValue(added_windows_, window) && visible) { |
160 added_windows_.erase(window); | 160 added_windows_.erase(window); |
161 window->RemoveObserver(this); | 161 window->RemoveObserver(this); |
162 MaximizeAndTrackWindow(window); | 162 MaximizeAndTrackWindow(window); |
163 // When the state got added, the "WM_EVENT_ADDED_TO_WORKSPACE" event got | 163 // When the state got added, the "WM_EVENT_ADDED_TO_WORKSPACE" event got |
164 // already sent and we have to notify our state again. | 164 // already sent and we have to notify our state again. |
165 if (base::ContainsKey(window_state_map_, window)) { | 165 if (base::ContainsKey(window_state_map_, window)) { |
166 wm::WMEvent event(wm::WM_EVENT_ADDED_TO_WORKSPACE); | 166 wm::WMEvent event(wm::WM_EVENT_ADDED_TO_WORKSPACE); |
167 wm::GetWindowState(window)->OnWMEvent(&event); | 167 wm::GetWindowState(window)->OnWMEvent(&event); |
168 } | 168 } |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 void MaximizeModeWindowManager::OnDisplayAdded( | 172 void TabletModeWindowManager::OnDisplayAdded(const display::Display& display) { |
| 173 DisplayConfigurationChanged(); |
| 174 } |
| 175 |
| 176 void TabletModeWindowManager::OnDisplayRemoved( |
173 const display::Display& display) { | 177 const display::Display& display) { |
174 DisplayConfigurationChanged(); | 178 DisplayConfigurationChanged(); |
175 } | 179 } |
176 | 180 |
177 void MaximizeModeWindowManager::OnDisplayRemoved( | 181 void TabletModeWindowManager::OnDisplayMetricsChanged(const display::Display&, |
178 const display::Display& display) { | 182 uint32_t) { |
179 DisplayConfigurationChanged(); | |
180 } | |
181 | |
182 void MaximizeModeWindowManager::OnDisplayMetricsChanged(const display::Display&, | |
183 uint32_t) { | |
184 // Nothing to do here. | 183 // Nothing to do here. |
185 } | 184 } |
186 | 185 |
187 void MaximizeModeWindowManager::SetIgnoreWmEventsForExit() { | 186 void TabletModeWindowManager::SetIgnoreWmEventsForExit() { |
188 for (auto& pair : window_state_map_) { | 187 for (auto& pair : window_state_map_) { |
189 pair.second->set_ignore_wm_events(true); | 188 pair.second->set_ignore_wm_events(true); |
190 } | 189 } |
191 } | 190 } |
192 | 191 |
193 MaximizeModeWindowManager::MaximizeModeWindowManager() { | 192 TabletModeWindowManager::TabletModeWindowManager() { |
194 // The overview mode needs to be ended before the maximize mode is started. To | 193 // The overview mode needs to be ended before the tablet mode is started. To |
195 // guarantee the proper order, it will be turned off from here. | 194 // guarantee the proper order, it will be turned off from here. |
196 CancelOverview(); | 195 CancelOverview(); |
197 | 196 |
198 MaximizeAllWindows(); | 197 MaximizeAllWindows(); |
199 AddWindowCreationObservers(); | 198 AddWindowCreationObservers(); |
200 EnableBackdropBehindTopWindowOnEachDisplay(true); | 199 EnableBackdropBehindTopWindowOnEachDisplay(true); |
201 display::Screen::GetScreen()->AddObserver(this); | 200 display::Screen::GetScreen()->AddObserver(this); |
202 Shell::Get()->AddShellObserver(this); | 201 Shell::Get()->AddShellObserver(this); |
203 event_handler_ = ShellPort::Get()->CreateMaximizeModeEventHandler(); | 202 event_handler_ = ShellPort::Get()->CreateTabletModeEventHandler(); |
204 } | 203 } |
205 | 204 |
206 void MaximizeModeWindowManager::MaximizeAllWindows() { | 205 void TabletModeWindowManager::MaximizeAllWindows() { |
207 MruWindowTracker::WindowList windows = | 206 MruWindowTracker::WindowList windows = |
208 Shell::Get()->mru_window_tracker()->BuildWindowListIgnoreModal(); | 207 Shell::Get()->mru_window_tracker()->BuildWindowListIgnoreModal(); |
209 // Add all existing MRU windows. | 208 // Add all existing MRU windows. |
210 for (auto* window : windows) | 209 for (auto* window : windows) |
211 MaximizeAndTrackWindow(window); | 210 MaximizeAndTrackWindow(window); |
212 } | 211 } |
213 | 212 |
214 void MaximizeModeWindowManager::RestoreAllWindows() { | 213 void TabletModeWindowManager::RestoreAllWindows() { |
215 while (window_state_map_.size()) | 214 while (window_state_map_.size()) |
216 ForgetWindow(window_state_map_.begin()->first); | 215 ForgetWindow(window_state_map_.begin()->first); |
217 } | 216 } |
218 | 217 |
219 void MaximizeModeWindowManager::SetDeferBoundsUpdates( | 218 void TabletModeWindowManager::SetDeferBoundsUpdates(bool defer_bounds_updates) { |
220 bool defer_bounds_updates) { | |
221 for (auto& pair : window_state_map_) | 219 for (auto& pair : window_state_map_) |
222 pair.second->SetDeferBoundsUpdates(defer_bounds_updates); | 220 pair.second->SetDeferBoundsUpdates(defer_bounds_updates); |
223 } | 221 } |
224 | 222 |
225 void MaximizeModeWindowManager::MaximizeAndTrackWindow(aura::Window* window) { | 223 void TabletModeWindowManager::MaximizeAndTrackWindow(aura::Window* window) { |
226 if (!ShouldHandleWindow(window)) | 224 if (!ShouldHandleWindow(window)) |
227 return; | 225 return; |
228 | 226 |
229 DCHECK(!base::ContainsKey(window_state_map_, window)); | 227 DCHECK(!base::ContainsKey(window_state_map_, window)); |
230 window->AddObserver(this); | 228 window->AddObserver(this); |
231 | 229 |
232 // We create and remember a maximize mode state which will attach itself to | 230 // We create and remember a tablet mode state which will attach itself to |
233 // the provided state object. | 231 // the provided state object. |
234 window_state_map_[window] = new MaximizeModeWindowState(window, this); | 232 window_state_map_[window] = new TabletModeWindowState(window, this); |
235 } | 233 } |
236 | 234 |
237 void MaximizeModeWindowManager::ForgetWindow(aura::Window* window) { | 235 void TabletModeWindowManager::ForgetWindow(aura::Window* window) { |
238 WindowToState::iterator it = window_state_map_.find(window); | 236 WindowToState::iterator it = window_state_map_.find(window); |
239 | 237 |
240 // The following DCHECK could fail if our window state object was destroyed | 238 // The following DCHECK could fail if our window state object was destroyed |
241 // earlier by someone else. However - at this point there is no other client | 239 // earlier by someone else. However - at this point there is no other client |
242 // which replaces the state object and therefore this should not happen. | 240 // which replaces the state object and therefore this should not happen. |
243 DCHECK(it != window_state_map_.end()); | 241 DCHECK(it != window_state_map_.end()); |
244 window->RemoveObserver(this); | 242 window->RemoveObserver(this); |
245 | 243 |
246 // By telling the state object to revert, it will switch back the old | 244 // By telling the state object to revert, it will switch back the old |
247 // State object and destroy itself, calling WindowStateDestroyed(). | 245 // State object and destroy itself, calling WindowStateDestroyed(). |
248 it->second->LeaveMaximizeMode(wm::GetWindowState(it->first)); | 246 it->second->LeaveTabletMode(wm::GetWindowState(it->first)); |
249 DCHECK(!base::ContainsKey(window_state_map_, window)); | 247 DCHECK(!base::ContainsKey(window_state_map_, window)); |
250 } | 248 } |
251 | 249 |
252 bool MaximizeModeWindowManager::ShouldHandleWindow(aura::Window* window) { | 250 bool TabletModeWindowManager::ShouldHandleWindow(aura::Window* window) { |
253 DCHECK(window); | 251 DCHECK(window); |
254 | 252 |
255 // Windows with the always-on-top property should be free-floating and thus | 253 // Windows with the always-on-top property should be free-floating and thus |
256 // not managed by us. | 254 // not managed by us. |
257 if (window->GetProperty(aura::client::kAlwaysOnTopKey)) | 255 if (window->GetProperty(aura::client::kAlwaysOnTopKey)) |
258 return false; | 256 return false; |
259 | 257 |
260 // If the changing bounds in the maximized/fullscreen is allowed, then | 258 // If the changing bounds in the maximized/fullscreen is allowed, then |
261 // let the client manage it even in maximized mode. | 259 // let the client manage it even in tablet mode. |
262 if (wm::GetWindowState(window)->allow_set_bounds_direct()) | 260 if (wm::GetWindowState(window)->allow_set_bounds_direct()) |
263 return false; | 261 return false; |
264 | 262 |
265 return window->type() == aura::client::WINDOW_TYPE_NORMAL; | 263 return window->type() == aura::client::WINDOW_TYPE_NORMAL; |
266 } | 264 } |
267 | 265 |
268 void MaximizeModeWindowManager::AddWindowCreationObservers() { | 266 void TabletModeWindowManager::AddWindowCreationObservers() { |
269 DCHECK(observed_container_windows_.empty()); | 267 DCHECK(observed_container_windows_.empty()); |
270 // Observe window activations/creations in the default containers on all root | 268 // Observe window activations/creations in the default containers on all root |
271 // windows. | 269 // windows. |
272 for (aura::Window* root : Shell::GetAllRootWindows()) { | 270 for (aura::Window* root : Shell::GetAllRootWindows()) { |
273 aura::Window* default_container = | 271 aura::Window* default_container = |
274 root->GetChildById(kShellWindowId_DefaultContainer); | 272 root->GetChildById(kShellWindowId_DefaultContainer); |
275 DCHECK(!base::ContainsKey(observed_container_windows_, default_container)); | 273 DCHECK(!base::ContainsKey(observed_container_windows_, default_container)); |
276 default_container->AddObserver(this); | 274 default_container->AddObserver(this); |
277 observed_container_windows_.insert(default_container); | 275 observed_container_windows_.insert(default_container); |
278 } | 276 } |
279 } | 277 } |
280 | 278 |
281 void MaximizeModeWindowManager::RemoveWindowCreationObservers() { | 279 void TabletModeWindowManager::RemoveWindowCreationObservers() { |
282 for (aura::Window* window : observed_container_windows_) | 280 for (aura::Window* window : observed_container_windows_) |
283 window->RemoveObserver(this); | 281 window->RemoveObserver(this); |
284 observed_container_windows_.clear(); | 282 observed_container_windows_.clear(); |
285 } | 283 } |
286 | 284 |
287 void MaximizeModeWindowManager::DisplayConfigurationChanged() { | 285 void TabletModeWindowManager::DisplayConfigurationChanged() { |
288 EnableBackdropBehindTopWindowOnEachDisplay(false); | 286 EnableBackdropBehindTopWindowOnEachDisplay(false); |
289 RemoveWindowCreationObservers(); | 287 RemoveWindowCreationObservers(); |
290 AddWindowCreationObservers(); | 288 AddWindowCreationObservers(); |
291 EnableBackdropBehindTopWindowOnEachDisplay(true); | 289 EnableBackdropBehindTopWindowOnEachDisplay(true); |
292 } | 290 } |
293 | 291 |
294 bool MaximizeModeWindowManager::IsContainerWindow(aura::Window* window) { | 292 bool TabletModeWindowManager::IsContainerWindow(aura::Window* window) { |
295 return base::ContainsKey(observed_container_windows_, window); | 293 return base::ContainsKey(observed_container_windows_, window); |
296 } | 294 } |
297 | 295 |
298 void MaximizeModeWindowManager::EnableBackdropBehindTopWindowOnEachDisplay( | 296 void TabletModeWindowManager::EnableBackdropBehindTopWindowOnEachDisplay( |
299 bool enable) { | 297 bool enable) { |
300 // Inform the WorkspaceLayoutManager that we want to show a backdrop behind | 298 // Inform the WorkspaceLayoutManager that we want to show a backdrop behind |
301 // the topmost window of its container. | 299 // the topmost window of its container. |
302 for (auto* controller : Shell::GetAllRootWindowControllers()) { | 300 for (auto* controller : Shell::GetAllRootWindowControllers()) { |
303 controller->workspace_controller()->SetBackdropDelegate( | 301 controller->workspace_controller()->SetBackdropDelegate( |
304 enable ? base::MakeUnique<MaximizeModeBackdropDelegateImpl>() | 302 enable ? base::MakeUnique<TabletModeBackdropDelegateImpl>() : nullptr); |
305 : nullptr); | |
306 } | 303 } |
307 } | 304 } |
308 | 305 |
309 } // namespace ash | 306 } // namespace ash |
OLD | NEW |