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

Side by Side Diff: ash/mus/root_window_controller.h

Issue 2620913003: Removes WmRootWindowController subclasses (Closed)
Patch Set: WmLookupAura::GetRootWindowControllerWithDisplayId needs to handle null 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 #ifndef ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ 5 #ifndef ASH_MUS_ROOT_WINDOW_CONTROLLER_H_
6 #define ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ 6 #define ASH_MUS_ROOT_WINDOW_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/mus/disconnected_app_handler.h" 10 #include "ash/mus/disconnected_app_handler.h"
11 #include "ash/root_window_controller.h"
11 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" 12 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
12 #include "ui/display/display.h" 13 #include "ui/display/display.h"
13 14
14 namespace aura { 15 namespace aura {
15 class WindowTreeHostMus; 16 class WindowTreeHostMus;
16 namespace client {
17 class WindowParentingClient;
18 }
19 } 17 }
20 18
21 namespace gfx { 19 namespace gfx {
22 class Insets; 20 class Insets;
23 } 21 }
24 22
25 namespace service_manager { 23 namespace service_manager {
26 class Connector; 24 class Connector;
27 } 25 }
28 26
29 namespace ash { 27 namespace ash {
30
31 class WmShelf;
32
33 namespace mus { 28 namespace mus {
34 29
35 class WindowManager; 30 class WindowManager;
36 class WmRootWindowControllerMus;
37 class WmTestBase; 31 class WmTestBase;
38 class WmTestHelper; 32 class WmTestHelper;
39 class WmWindowMus; 33 class WmWindowMus;
40 34
41 // RootWindowController manages the windows and state for a single display. 35 // RootWindowController manages the windows and state for a single display.
42 // RootWindowController takes ownership of the WindowTreeHostMus that it passed 36 // RootWindowController takes ownership of the WindowTreeHostMus that it passed
43 // to it. 37 // to it.
44 class RootWindowController { 38 class RootWindowController {
James Cook 2017/01/10 22:41:13 Aside: It's super confusing we have classes named
sky 2017/01/10 23:06:56 Agreed. I added TODO.
45 public: 39 public:
46 RootWindowController( 40 RootWindowController(
47 WindowManager* window_manager, 41 WindowManager* window_manager,
48 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, 42 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
49 const display::Display& display); 43 const display::Display& display,
44 ash::RootWindowController::RootWindowType root_window_type);
50 ~RootWindowController(); 45 ~RootWindowController();
51 46
47 // Returns the RootWindowController for |window|'s root.
48 static RootWindowController* ForWindow(aura::Window* window);
49
52 void Shutdown(); 50 void Shutdown();
53 51
54 service_manager::Connector* GetConnector(); 52 service_manager::Connector* GetConnector();
55 53
56 aura::Window* root(); 54 aura::Window* root();
57 const aura::Window* root() const; 55 const aura::Window* root() const;
58 WmRootWindowControllerMus* wm_root_window_controller() {
59 return wm_root_window_controller_.get();
60 }
61 56
62 aura::Window* NewTopLevelWindow( 57 aura::Window* NewTopLevelWindow(
63 ui::mojom::WindowType window_type, 58 ui::mojom::WindowType window_type,
64 std::map<std::string, std::vector<uint8_t>>* properties); 59 std::map<std::string, std::vector<uint8_t>>* properties);
65 60
66 WmWindowMus* GetWindowByShellWindowId(int id); 61 WmWindowMus* GetWindowByShellWindowId(int id);
67 62
68 void SetWorkAreaInests(const gfx::Insets& insets); 63 void SetWorkAreaInests(const gfx::Insets& insets);
69 void SetDisplay(const display::Display& display); 64 void SetDisplay(const display::Display& display);
70 65
71 WindowManager* window_manager() { return window_manager_; } 66 WindowManager* window_manager() { return window_manager_; }
72 67
73 aura::WindowTreeHostMus* window_tree_host() { 68 aura::WindowTreeHostMus* window_tree_host() { return window_tree_host_; }
74 return window_tree_host_.get();
75 }
76 69
77 const display::Display& display() const { return display_; } 70 const display::Display& display() const { return display_; }
78 71
79 WmShelf* wm_shelf() { return wm_shelf_.get(); } 72 ash::RootWindowController* ash_root_window_controller() {
73 return ash_root_window_controller_.get();
74 }
80 75
81 private: 76 private:
82 friend class WmTestBase; 77 friend class WmTestBase;
83 friend class WmTestHelper; 78 friend class WmTestHelper;
84 79
85 gfx::Rect CalculateDefaultBounds( 80 gfx::Rect CalculateDefaultBounds(
86 aura::Window* container_window, 81 aura::Window* container_window,
87 const std::map<std::string, std::vector<uint8_t>>* properties) const; 82 const std::map<std::string, std::vector<uint8_t>>* properties) const;
88 gfx::Rect GetMaximizedWindowBounds() const; 83 gfx::Rect GetMaximizedWindowBounds() const;
89 84
90 WindowManager* window_manager_; 85 WindowManager* window_manager_;
91 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_; 86 std::unique_ptr<ash::RootWindowController> ash_root_window_controller_;
87 // Owned by |ash_root_window_controller_|.
88 aura::WindowTreeHostMus* window_tree_host_;
92 int window_count_ = 0; 89 int window_count_ = 0;
93 90
94 display::Display display_; 91 display::Display display_;
95 92
96 std::unique_ptr<WmRootWindowControllerMus> wm_root_window_controller_;
97 std::unique_ptr<WmShelf> wm_shelf_;
98
99 std::unique_ptr<aura::client::WindowParentingClient> parenting_client_;
100
101 std::unique_ptr<DisconnectedAppHandler> disconnected_app_handler_; 93 std::unique_ptr<DisconnectedAppHandler> disconnected_app_handler_;
102 94
103 DISALLOW_COPY_AND_ASSIGN(RootWindowController); 95 DISALLOW_COPY_AND_ASSIGN(RootWindowController);
104 }; 96 };
105 97
106 } // namespace mus 98 } // namespace mus
107 } // namespace ash 99 } // namespace ash
108 100
109 #endif // ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ 101 #endif // ASH_MUS_ROOT_WINDOW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698