OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_WINDOW_MANAGER_H_ | 5 #ifndef MASH_WM_WINDOW_MANAGER_H_ |
6 #define MASH_WM_WINDOW_MANAGER_H_ | 6 #define MASH_WM_WINDOW_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "components/mus/common/types.h" | 11 #include "components/mus/common/types.h" |
12 #include "components/mus/public/cpp/window_manager_delegate.h" | 12 #include "components/mus/public/cpp/window_manager_delegate.h" |
13 #include "components/mus/public/cpp/window_observer.h" | 13 #include "components/mus/public/cpp/window_observer.h" |
14 #include "components/mus/public/interfaces/window_manager.mojom.h" | 14 #include "components/mus/public/interfaces/window_manager.mojom.h" |
15 | 15 |
16 namespace mash { | 16 namespace mash { |
17 namespace wm { | 17 namespace wm { |
18 | 18 |
19 class RootWindowController; | 19 class RootWindowController; |
20 | 20 |
21 class WindowManager : public mus::WindowObserver, | 21 class WindowManager : public mus::WindowObserver, |
22 public mus::WindowManagerDelegate { | 22 public mus::WindowManagerDelegate { |
23 public: | 23 public: |
24 WindowManager(); | 24 WindowManager(); |
25 ~WindowManager() override; | 25 ~WindowManager() override; |
26 | 26 |
27 void Initialize(RootWindowController* root_controller); | 27 void Initialize(RootWindowController* root_controller); |
28 | 28 |
| 29 mus::WindowManagerClient* window_manager_client() { |
| 30 return window_manager_client_; |
| 31 } |
| 32 |
29 private: | 33 private: |
30 gfx::Rect CalculateDefaultBounds(mus::Window* window) const; | 34 gfx::Rect CalculateDefaultBounds(mus::Window* window) const; |
31 gfx::Rect GetMaximizedWindowBounds() const; | 35 gfx::Rect GetMaximizedWindowBounds() const; |
32 | 36 |
33 mus::Window* NewTopLevelWindow( | 37 mus::Window* NewTopLevelWindow( |
34 std::map<std::string, std::vector<uint8_t>>* properties); | 38 std::map<std::string, std::vector<uint8_t>>* properties); |
35 | 39 |
36 // mus::WindowObserver: | 40 // mus::WindowObserver: |
37 void OnTreeChanging(const TreeChangeParams& params) override; | 41 void OnTreeChanging(const TreeChangeParams& params) override; |
38 void OnWindowEmbeddedAppDisconnected(mus::Window* window) override; | 42 void OnWindowEmbeddedAppDisconnected(mus::Window* window) override; |
39 | 43 |
40 // WindowManagerDelegate: | 44 // WindowManagerDelegate: |
41 void SetWindowManagerClient(mus::WindowManagerClient* client) override; | 45 void SetWindowManagerClient(mus::WindowManagerClient* client) override; |
42 bool OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) override; | 46 bool OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) override; |
43 bool OnWmSetProperty(mus::Window* window, | 47 bool OnWmSetProperty(mus::Window* window, |
44 const std::string& name, | 48 const std::string& name, |
45 scoped_ptr<std::vector<uint8_t>>* new_data) override; | 49 scoped_ptr<std::vector<uint8_t>>* new_data) override; |
46 mus::Window* OnWmCreateTopLevelWindow( | 50 mus::Window* OnWmCreateTopLevelWindow( |
47 std::map<std::string, std::vector<uint8_t>>* properties) override; | 51 std::map<std::string, std::vector<uint8_t>>* properties) override; |
| 52 void OnAccelerator(uint32_t id, mus::mojom::EventPtr event) override; |
48 | 53 |
49 RootWindowController* root_controller_; | 54 RootWindowController* root_controller_; |
50 mus::WindowManagerClient* window_manager_client_; | 55 mus::WindowManagerClient* window_manager_client_; |
51 | 56 |
52 DISALLOW_COPY_AND_ASSIGN(WindowManager); | 57 DISALLOW_COPY_AND_ASSIGN(WindowManager); |
53 }; | 58 }; |
54 | 59 |
55 } // namespace wm | 60 } // namespace wm |
56 } // namespace mash | 61 } // namespace mash |
57 | 62 |
58 #endif // MASH_WM_WINDOW_MANAGER_H_ | 63 #endif // MASH_WM_WINDOW_MANAGER_H_ |
OLD | NEW |