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

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

Issue 2539363005: Converts ash to use aura-mus (Closed)
Patch Set: feedback2 Created 4 years 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 "services/ui/public/cpp/window_observer.h"
12 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" 11 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
13 #include "ui/display/display.h" 12 #include "ui/display/display.h"
14 13
14 namespace aura {
15 class WindowTreeHostMus;
16 namespace client {
17 class WindowParentingClient;
18 }
19 }
20
15 namespace gfx { 21 namespace gfx {
16 class Insets; 22 class Insets;
17 } 23 }
18 24
19 namespace service_manager { 25 namespace service_manager {
20 class Connector; 26 class Connector;
21 } 27 }
22 28
23 namespace ash { 29 namespace ash {
24 30
25 namespace mus { 31 namespace mus {
26 32
27 class LayoutManager;
28 class WindowManager; 33 class WindowManager;
29 class WmRootWindowControllerMus; 34 class WmRootWindowControllerMus;
30 class WmShelfMus; 35 class WmShelfMus;
31 class WmTestBase; 36 class WmTestBase;
32 class WmTestHelper; 37 class WmTestHelper;
33 class WmWindowMus; 38 class WmWindowMus;
34 39
35 // RootWindowController manages the windows and state for a single display. 40 // RootWindowController manages the windows and state for a single display.
36 // RootWindowController takes ownership of the Window that it passed to it. 41 // RootWindowController takes ownership of the WindowTreeHostMus that it passed
42 // to it.
37 class RootWindowController { 43 class RootWindowController {
38 public: 44 public:
39 RootWindowController(WindowManager* window_manager, 45 RootWindowController(
40 ui::Window* root, 46 WindowManager* window_manager,
41 const display::Display& display); 47 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
48 const display::Display& display);
42 ~RootWindowController(); 49 ~RootWindowController();
43 50
44 void Shutdown(); 51 void Shutdown();
45 52
46 service_manager::Connector* GetConnector(); 53 service_manager::Connector* GetConnector();
47 54
48 ui::Window* root() { return root_; } 55 aura::Window* root();
56 const aura::Window* root() const;
49 WmRootWindowControllerMus* wm_root_window_controller() { 57 WmRootWindowControllerMus* wm_root_window_controller() {
50 return wm_root_window_controller_.get(); 58 return wm_root_window_controller_.get();
51 } 59 }
52 60
53 ui::Window* NewTopLevelWindow( 61 aura::Window* NewTopLevelWindow(
62 ui::mojom::WindowType window_type,
54 std::map<std::string, std::vector<uint8_t>>* properties); 63 std::map<std::string, std::vector<uint8_t>>* properties);
55 64
56 WmWindowMus* GetWindowByShellWindowId(int id); 65 WmWindowMus* GetWindowByShellWindowId(int id);
57 66
58 void SetWorkAreaInests(const gfx::Insets& insets); 67 void SetWorkAreaInests(const gfx::Insets& insets);
59 void SetDisplay(const display::Display& display); 68 void SetDisplay(const display::Display& display);
60 69
61 WindowManager* window_manager() { return window_manager_; } 70 WindowManager* window_manager() { return window_manager_; }
62 71
72 aura::WindowTreeHostMus* window_tree_host() {
73 return window_tree_host_.get();
74 }
75
63 const display::Display& display() const { return display_; } 76 const display::Display& display() const { return display_; }
64 77
65 WmShelfMus* wm_shelf() { return wm_shelf_.get(); } 78 WmShelfMus* wm_shelf() { return wm_shelf_.get(); }
66 79
67 private: 80 private:
68 friend class WmTestBase; 81 friend class WmTestBase;
69 friend class WmTestHelper; 82 friend class WmTestHelper;
70 83
71 gfx::Rect CalculateDefaultBounds(ui::Window* window) const; 84 gfx::Rect CalculateDefaultBounds(
85 aura::Window* container_window,
86 const std::map<std::string, std::vector<uint8_t>>* properties) const;
72 gfx::Rect GetMaximizedWindowBounds() const; 87 gfx::Rect GetMaximizedWindowBounds() const;
73 88
74 // Creates the necessary set of layout managers in the shell windows.
75 void CreateLayoutManagers();
76
77 WindowManager* window_manager_; 89 WindowManager* window_manager_;
78 ui::Window* root_; 90 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host_;
79 int window_count_ = 0; 91 int window_count_ = 0;
80 92
81 display::Display display_; 93 display::Display display_;
82 94
83 std::unique_ptr<WmRootWindowControllerMus> wm_root_window_controller_; 95 std::unique_ptr<WmRootWindowControllerMus> wm_root_window_controller_;
84 std::unique_ptr<WmShelfMus> wm_shelf_; 96 std::unique_ptr<WmShelfMus> wm_shelf_;
85 97
86 std::map<ui::Window*, std::unique_ptr<LayoutManager>> layout_managers_; 98 std::unique_ptr<aura::client::WindowParentingClient> parenting_client_;
87 99
88 std::unique_ptr<DisconnectedAppHandler> disconnected_app_handler_; 100 std::unique_ptr<DisconnectedAppHandler> disconnected_app_handler_;
89 101
90 DISALLOW_COPY_AND_ASSIGN(RootWindowController); 102 DISALLOW_COPY_AND_ASSIGN(RootWindowController);
91 }; 103 };
92 104
93 } // namespace mus 105 } // namespace mus
94 } // namespace ash 106 } // namespace ash
95 107
96 #endif // ASH_MUS_ROOT_WINDOW_CONTROLLER_H_ 108 #endif // ASH_MUS_ROOT_WINDOW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698