Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Side by Side Diff: ash/mus/bridge/wm_shell_mus.cc

Issue 2642003002: Removes ash::mus::RootWindowController (Closed)
Patch Set: feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/mus/bridge/wm_shell_mus.h" 5 #include "ash/mus/bridge/wm_shell_mus.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/accelerators/accelerator_controller.h" 9 #include "ash/common/accelerators/accelerator_controller.h"
10 #include "ash/common/key_event_watcher.h" 10 #include "ash/common/key_event_watcher.h"
11 #include "ash/common/session/session_state_delegate.h" 11 #include "ash/common/session/session_state_delegate.h"
12 #include "ash/common/shell_delegate.h" 12 #include "ash/common/shell_delegate.h"
13 #include "ash/common/shell_observer.h" 13 #include "ash/common/shell_observer.h"
14 #include "ash/common/system/tray/system_tray_delegate.h" 14 #include "ash/common/system/tray/system_tray_delegate.h"
15 #include "ash/common/wallpaper/wallpaper_delegate.h" 15 #include "ash/common/wallpaper/wallpaper_delegate.h"
16 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h" 16 #include "ash/common/wm/maximize_mode/maximize_mode_event_handler.h"
17 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h" 17 #include "ash/common/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard .h"
18 #include "ash/common/wm/mru_window_tracker.h" 18 #include "ash/common/wm/mru_window_tracker.h"
19 #include "ash/common/wm/window_cycle_event_filter.h" 19 #include "ash/common/wm/window_cycle_event_filter.h"
20 #include "ash/common/wm/window_resizer.h" 20 #include "ash/common/wm/window_resizer.h"
21 #include "ash/common/wm_window.h" 21 #include "ash/common/wm_window.h"
22 #include "ash/mus/accelerators/accelerator_controller_delegate_mus.h" 22 #include "ash/mus/accelerators/accelerator_controller_delegate_mus.h"
23 #include "ash/mus/accelerators/accelerator_controller_registrar.h" 23 #include "ash/mus/accelerators/accelerator_controller_registrar.h"
24 #include "ash/mus/bridge/immersive_handler_factory_mus.h" 24 #include "ash/mus/bridge/immersive_handler_factory_mus.h"
25 #include "ash/mus/bridge/workspace_event_handler_mus.h" 25 #include "ash/mus/bridge/workspace_event_handler_mus.h"
26 #include "ash/mus/drag_window_resizer.h" 26 #include "ash/mus/drag_window_resizer.h"
27 #include "ash/mus/keyboard_ui_mus.h" 27 #include "ash/mus/keyboard_ui_mus.h"
28 #include "ash/mus/root_window_controller.h" 28 #include "ash/mus/screen_mus.h"
29 #include "ash/mus/window_manager.h" 29 #include "ash/mus/window_manager.h"
30 #include "ash/root_window_controller.h"
30 #include "ash/root_window_settings.h" 31 #include "ash/root_window_settings.h"
31 #include "ash/shared/immersive_fullscreen_controller.h" 32 #include "ash/shared/immersive_fullscreen_controller.h"
32 #include "ash/shell.h" 33 #include "ash/shell.h"
33 #include "ash/shell_init_params.h" 34 #include "ash/shell_init_params.h"
34 #include "ash/wm/window_util.h" 35 #include "ash/wm/window_util.h"
35 #include "base/memory/ptr_util.h" 36 #include "base/memory/ptr_util.h"
36 #include "components/user_manager/user_info_impl.h" 37 #include "components/user_manager/user_info_impl.h"
37 #include "ui/aura/mus/window_tree_client.h" 38 #include "ui/aura/mus/window_tree_client.h"
38 #include "ui/aura/mus/window_tree_host_mus.h" 39 #include "ui/aura/mus/window_tree_host_mus.h"
39 #include "ui/aura/window.h" 40 #include "ui/aura/window.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 WmShell::Set(nullptr); 143 WmShell::Set(nullptr);
143 } 144 }
144 145
145 // static 146 // static
146 WmShellMus* WmShellMus::Get() { 147 WmShellMus* WmShellMus::Get() {
147 return static_cast<WmShellMus*>(WmShell::Get()); 148 return static_cast<WmShellMus*>(WmShell::Get());
148 } 149 }
149 150
150 RootWindowController* WmShellMus::GetRootWindowControllerWithDisplayId( 151 RootWindowController* WmShellMus::GetRootWindowControllerWithDisplayId(
151 int64_t id) { 152 int64_t id) {
152 for (ash::RootWindowController* root_window_controller : 153 for (RootWindowController* root_window_controller :
153 ash::RootWindowController::root_window_controllers()) { 154 RootWindowController::root_window_controllers()) {
154 RootWindowSettings* settings = 155 RootWindowSettings* settings =
155 GetRootWindowSettings(root_window_controller->GetRootWindow()); 156 GetRootWindowSettings(root_window_controller->GetRootWindow());
156 DCHECK(settings); 157 DCHECK(settings);
157 if (settings->display_id == id) { 158 if (settings->display_id == id)
158 return RootWindowController::ForWindow( 159 return root_window_controller;
159 root_window_controller->GetRootWindow());
160 }
161 } 160 }
162 NOTREACHED(); 161 NOTREACHED();
163 return nullptr; 162 return nullptr;
164 } 163 }
165 164
166 aura::WindowTreeClient* WmShellMus::window_tree_client() { 165 aura::WindowTreeClient* WmShellMus::window_tree_client() {
167 return window_manager_->window_tree_client(); 166 return window_manager_->window_tree_client();
168 } 167 }
169 168
170 void WmShellMus::Initialize( 169 void WmShellMus::Initialize(
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 return WmWindow::Get(::wm::CaptureController::Get()->GetCaptureWindow()); 206 return WmWindow::Get(::wm::CaptureController::Get()->GetCaptureWindow());
208 } 207 }
209 208
210 WmWindow* WmShellMus::GetPrimaryRootWindow() { 209 WmWindow* WmShellMus::GetPrimaryRootWindow() {
211 // NOTE: This is called before the RootWindowController has been created, so 210 // NOTE: This is called before the RootWindowController has been created, so
212 // it can't call through to RootWindowController to get all windows. 211 // it can't call through to RootWindowController to get all windows.
213 return primary_root_window_; 212 return primary_root_window_;
214 } 213 }
215 214
216 WmWindow* WmShellMus::GetRootWindowForDisplayId(int64_t display_id) { 215 WmWindow* WmShellMus::GetRootWindowForDisplayId(int64_t display_id) {
217 return WmWindow::Get( 216 RootWindowController* root_window_controller =
218 GetRootWindowControllerWithDisplayId(display_id)->root()); 217 GetRootWindowControllerWithDisplayId(display_id);
218 DCHECK(root_window_controller);
219 return WmWindow::Get(root_window_controller->GetRootWindow());
219 } 220 }
220 221
221 const display::ManagedDisplayInfo& WmShellMus::GetDisplayInfo( 222 const display::ManagedDisplayInfo& WmShellMus::GetDisplayInfo(
222 int64_t display_id) const { 223 int64_t display_id) const {
223 // TODO(mash): implement http://crbug.com/622480. 224 // TODO(mash): implement http://crbug.com/622480.
224 NOTIMPLEMENTED(); 225 NOTIMPLEMENTED();
225 static display::ManagedDisplayInfo fake_info; 226 static display::ManagedDisplayInfo fake_info;
226 return fake_info; 227 return fake_info;
227 } 228 }
228 229
(...skipping 21 matching lines...) Expand all
250 return false; 251 return false;
251 } 252 }
252 253
253 bool WmShellMus::IsForceMaximizeOnFirstRun() { 254 bool WmShellMus::IsForceMaximizeOnFirstRun() {
254 NOTIMPLEMENTED(); 255 NOTIMPLEMENTED();
255 return false; 256 return false;
256 } 257 }
257 258
258 void WmShellMus::SetDisplayWorkAreaInsets(WmWindow* window, 259 void WmShellMus::SetDisplayWorkAreaInsets(WmWindow* window,
259 const gfx::Insets& insets) { 260 const gfx::Insets& insets) {
260 RootWindowController* root_window_controller = 261 window_manager_->screen()->SetWorkAreaInsets(window->aura_window(), insets);
261 RootWindowController::ForWindow(window->aura_window());
262 root_window_controller->SetWorkAreaInests(insets);
263 } 262 }
264 263
265 bool WmShellMus::IsPinned() { 264 bool WmShellMus::IsPinned() {
266 NOTIMPLEMENTED(); 265 NOTIMPLEMENTED();
267 return false; 266 return false;
268 } 267 }
269 268
270 void WmShellMus::SetPinnedWindow(WmWindow* window) { 269 void WmShellMus::SetPinnedWindow(WmWindow* window) {
271 NOTIMPLEMENTED(); 270 NOTIMPLEMENTED();
272 } 271 }
273 272
274 void WmShellMus::LockCursor() { 273 void WmShellMus::LockCursor() {
275 // TODO: http::/crbug.com/637853 274 // TODO: http::/crbug.com/637853
276 NOTIMPLEMENTED(); 275 NOTIMPLEMENTED();
277 } 276 }
278 277
279 void WmShellMus::UnlockCursor() { 278 void WmShellMus::UnlockCursor() {
280 // TODO: http::/crbug.com/637853 279 // TODO: http::/crbug.com/637853
281 NOTIMPLEMENTED(); 280 NOTIMPLEMENTED();
282 } 281 }
283 282
284 bool WmShellMus::IsMouseEventsEnabled() { 283 bool WmShellMus::IsMouseEventsEnabled() {
285 // TODO: http::/crbug.com/637853 284 // TODO: http::/crbug.com/637853
286 NOTIMPLEMENTED(); 285 NOTIMPLEMENTED();
287 return true; 286 return true;
288 } 287 }
289 288
290 std::vector<WmWindow*> WmShellMus::GetAllRootWindows() { 289 std::vector<WmWindow*> WmShellMus::GetAllRootWindows() {
291 std::vector<WmWindow*> root_windows; 290 std::vector<WmWindow*> root_windows;
292 for (ash::RootWindowController* root_window_controller : 291 for (RootWindowController* root_window_controller :
293 ash::RootWindowController::root_window_controllers()) { 292 RootWindowController::root_window_controllers()) {
294 root_windows.push_back(root_window_controller->GetWindow()); 293 root_windows.push_back(root_window_controller->GetWindow());
295 } 294 }
296 return root_windows; 295 return root_windows;
297 } 296 }
298 297
299 void WmShellMus::RecordGestureAction(GestureActionType action) { 298 void WmShellMus::RecordGestureAction(GestureActionType action) {
300 // TODO: http://crbug.com/616581. 299 // TODO: http://crbug.com/616581.
301 NOTIMPLEMENTED(); 300 NOTIMPLEMENTED();
302 } 301 }
303 302
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 412 }
414 413
415 void WmShellMus::CreatePrimaryHost() {} 414 void WmShellMus::CreatePrimaryHost() {}
416 415
417 void WmShellMus::InitHosts(const ShellInitParams& init_params) { 416 void WmShellMus::InitHosts(const ShellInitParams& init_params) {
418 window_manager_->CreatePrimaryRootWindowController( 417 window_manager_->CreatePrimaryRootWindowController(
419 base::WrapUnique(init_params.primary_window_tree_host)); 418 base::WrapUnique(init_params.primary_window_tree_host));
420 } 419 }
421 } // namespace mus 420 } // namespace mus
422 } // namespace ash 421 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698