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 ASH_MUS_WINDOW_MANAGER_H_ |
6 #define MASH_WM_WINDOW_MANAGER_H_ | 6 #define ASH_MUS_WINDOW_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
| 12 #include "ash/mus/disconnected_app_handler.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "components/mus/common/types.h" | 14 #include "components/mus/common/types.h" |
14 #include "components/mus/public/cpp/window_manager_delegate.h" | 15 #include "components/mus/public/cpp/window_manager_delegate.h" |
15 #include "components/mus/public/cpp/window_observer.h" | 16 #include "components/mus/public/cpp/window_observer.h" |
16 #include "components/mus/public/cpp/window_tracker.h" | 17 #include "components/mus/public/cpp/window_tracker.h" |
17 #include "components/mus/public/interfaces/window_manager.mojom.h" | 18 #include "components/mus/public/interfaces/window_manager.mojom.h" |
18 #include "mash/session/public/interfaces/session.mojom.h" | 19 #include "mash/session/public/interfaces/session.mojom.h" |
19 #include "mash/wm/disconnected_app_handler.h" | |
20 #include "mojo/public/cpp/bindings/binding.h" | 20 #include "mojo/public/cpp/bindings/binding.h" |
21 | 21 |
22 namespace mash { | 22 namespace ash { |
23 namespace wm { | 23 namespace mus { |
24 | 24 |
25 class RootWindowController; | 25 class RootWindowController; |
26 | 26 |
27 class WindowManager : public mus::WindowTracker, | 27 class WindowManager : public ::mus::WindowTracker, |
28 public mus::WindowManagerDelegate, | 28 public ::mus::WindowManagerDelegate, |
29 public session::mojom::ScreenlockStateListener { | 29 public mash::session::mojom::ScreenlockStateListener { |
30 public: | 30 public: |
31 WindowManager(); | 31 WindowManager(); |
32 ~WindowManager() override; | 32 ~WindowManager() override; |
33 | 33 |
34 void Initialize(RootWindowController* root_controller, | 34 void Initialize(RootWindowController* root_controller, |
35 session::mojom::Session* session); | 35 mash::session::mojom::Session* session); |
36 | 36 |
37 mus::WindowManagerClient* window_manager_client() { | 37 ::mus::WindowManagerClient* window_manager_client() { |
38 return window_manager_client_; | 38 return window_manager_client_; |
39 } | 39 } |
40 | 40 |
41 // Creates a new top level window. | 41 // Creates a new top level window. |
42 mus::Window* NewTopLevelWindow( | 42 ::mus::Window* NewTopLevelWindow( |
43 std::map<std::string, std::vector<uint8_t>>* properties); | 43 std::map<std::string, std::vector<uint8_t>>* properties); |
44 | 44 |
45 private: | 45 private: |
46 gfx::Rect CalculateDefaultBounds(mus::Window* window) const; | 46 gfx::Rect CalculateDefaultBounds(::mus::Window* window) const; |
47 gfx::Rect GetMaximizedWindowBounds() const; | 47 gfx::Rect GetMaximizedWindowBounds() const; |
48 | 48 |
49 // mus::WindowObserver: | 49 // ::mus::WindowObserver: |
50 void OnTreeChanging(const TreeChangeParams& params) override; | 50 void OnTreeChanging(const TreeChangeParams& params) override; |
51 | 51 |
52 // WindowManagerDelegate: | 52 // WindowManagerDelegate: |
53 void SetWindowManagerClient(mus::WindowManagerClient* client) override; | 53 void SetWindowManagerClient(::mus::WindowManagerClient* client) override; |
54 bool OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) override; | 54 bool OnWmSetBounds(::mus::Window* window, gfx::Rect* bounds) override; |
55 bool OnWmSetProperty( | 55 bool OnWmSetProperty( |
56 mus::Window* window, | 56 ::mus::Window* window, |
57 const std::string& name, | 57 const std::string& name, |
58 std::unique_ptr<std::vector<uint8_t>>* new_data) override; | 58 std::unique_ptr<std::vector<uint8_t>>* new_data) override; |
59 mus::Window* OnWmCreateTopLevelWindow( | 59 ::mus::Window* OnWmCreateTopLevelWindow( |
60 std::map<std::string, std::vector<uint8_t>>* properties) override; | 60 std::map<std::string, std::vector<uint8_t>>* properties) override; |
61 void OnWmClientJankinessChanged(const std::set<mus::Window*>& client_windows, | 61 void OnWmClientJankinessChanged( |
62 bool not_responding) override; | 62 const std::set<::mus::Window*>& client_windows, |
| 63 bool not_responding) override; |
63 void OnAccelerator(uint32_t id, const ui::Event& event) override; | 64 void OnAccelerator(uint32_t id, const ui::Event& event) override; |
64 | 65 |
65 // session::mojom::ScreenlockStateListener: | 66 // session::mojom::ScreenlockStateListener: |
66 void ScreenlockStateChanged(bool locked) override; | 67 void ScreenlockStateChanged(bool locked) override; |
67 | 68 |
68 RootWindowController* root_controller_; | 69 RootWindowController* root_controller_; |
69 mus::WindowManagerClient* window_manager_client_; | 70 ::mus::WindowManagerClient* window_manager_client_; |
70 DisconnectedAppHandler disconnected_app_handler_; | 71 DisconnectedAppHandler disconnected_app_handler_; |
71 | 72 |
72 mojo::Binding<session::mojom::ScreenlockStateListener> binding_; | 73 mojo::Binding<mash::session::mojom::ScreenlockStateListener> binding_; |
73 | 74 |
74 DISALLOW_COPY_AND_ASSIGN(WindowManager); | 75 DISALLOW_COPY_AND_ASSIGN(WindowManager); |
75 }; | 76 }; |
76 | 77 |
77 } // namespace wm | 78 } // namespace mus |
78 } // namespace mash | 79 } // namespace ash |
79 | 80 |
80 #endif // MASH_WM_WINDOW_MANAGER_H_ | 81 #endif // ASH_MUS_WINDOW_MANAGER_H_ |
OLD | NEW |