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 #ifndef MASH_WM_ROOT_WINDOW_CONTROLLER_H_ | 5 #ifndef MASH_WM_ROOT_WINDOW_CONTROLLER_H_ |
6 #define MASH_WM_ROOT_WINDOW_CONTROLLER_H_ | 6 #define MASH_WM_ROOT_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 #include "components/mus/public/cpp/window_observer.h" | 8 #include "components/mus/public/cpp/window_observer.h" |
9 #include "components/mus/public/cpp/window_tree_delegate.h" | 9 #include "components/mus/public/cpp/window_tree_delegate.h" |
10 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" | 10 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 mus::Window* root() { return root_; } | 50 mus::Window* root() { return root_; } |
51 | 51 |
52 int window_count() { return window_count_; } | 52 int window_count() { return window_count_; } |
53 void IncrementWindowCount() { ++window_count_; } | 53 void IncrementWindowCount() { ++window_count_; } |
54 | 54 |
55 mus::Window* GetWindowForContainer(mojom::Container container); | 55 mus::Window* GetWindowForContainer(mojom::Container container); |
56 mus::Window* GetWindowById(mus::Id id); | 56 mus::Window* GetWindowById(mus::Id id); |
57 bool WindowIsContainer(const mus::Window* window) const; | 57 bool WindowIsContainer(const mus::Window* window) const; |
58 | 58 |
| 59 WindowManager* window_manager() { return window_manager_.get(); } |
| 60 |
59 // TODO(sky): don't expose this, it may be null. | 61 // TODO(sky): don't expose this, it may be null. |
60 mus::mojom::WindowTreeHost* window_tree_host() { | 62 mus::mojom::WindowTreeHost* window_tree_host() { |
61 return window_tree_host_.get(); | 63 return window_tree_host_.get(); |
62 } | 64 } |
63 | 65 |
| 66 void OnAccelerator(uint32_t id, mus::mojom::EventPtr event); |
| 67 |
64 private: | 68 private: |
65 explicit RootWindowController(WindowManagerApplication* app); | 69 explicit RootWindowController(WindowManagerApplication* app); |
66 ~RootWindowController() override; | 70 ~RootWindowController() override; |
67 | 71 |
68 void AddAccelerators(); | 72 void AddAccelerators(); |
69 | 73 |
70 // Sets up the window containers used for z-space management. | 74 // Sets up the window containers used for z-space management. |
71 void CreateContainers(); | 75 void CreateContainers(); |
72 | 76 |
73 // WindowTreeHostClient: | |
74 void OnAccelerator(uint32_t id, mus::mojom::EventPtr event) override; | |
75 | |
76 // WindowTreeDelegate: | 77 // WindowTreeDelegate: |
77 void OnEmbed(mus::Window* root) override; | 78 void OnEmbed(mus::Window* root) override; |
78 void OnConnectionLost(mus::WindowTreeConnection* connection) override; | 79 void OnConnectionLost(mus::WindowTreeConnection* connection) override; |
79 | 80 |
80 // mus::WindowObserver: | 81 // mus::WindowObserver: |
81 void OnWindowDestroyed(mus::Window* window) override; | 82 void OnWindowDestroyed(mus::Window* window) override; |
82 | 83 |
83 WindowManagerApplication* app_; | 84 WindowManagerApplication* app_; |
84 mus::Window* root_; | 85 mus::Window* root_; |
85 int window_count_; | 86 int window_count_; |
(...skipping 12 matching lines...) Expand all Loading... |
98 | 99 |
99 mus::mojom::DisplayPtr display_; | 100 mus::mojom::DisplayPtr display_; |
100 | 101 |
101 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 102 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
102 }; | 103 }; |
103 | 104 |
104 } // namespace wm | 105 } // namespace wm |
105 } // namespace mash | 106 } // namespace mash |
106 | 107 |
107 #endif // MASH_WM_ROOT_WINDOW_CONTROLLER_H_ | 108 #endif // MASH_WM_ROOT_WINDOW_CONTROLLER_H_ |
OLD | NEW |