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_PROPERTY_UTIL_H_ | 5 #ifndef MASH_WM_PROPERTY_UTIL_H_ |
6 #define MASH_WM_PROPERTY_UTIL_H_ | 6 #define MASH_WM_PROPERTY_UTIL_H_ |
7 | 7 |
| 8 #include "ash/public/interfaces/ash_window_type.mojom.h" |
| 9 #include "ash/public/interfaces/container.mojom.h" |
8 #include "components/mus/public/cpp/window.h" | 10 #include "components/mus/public/cpp/window.h" |
9 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" | 11 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" |
10 #include "mash/wm/public/interfaces/ash_window_type.mojom.h" | |
11 #include "mash/wm/public/interfaces/container.mojom.h" | |
12 #include "ui/wm/public/window_types.h" | 12 #include "ui/wm/public/window_types.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class Rect; | 15 class Rect; |
16 class Size; | 16 class Size; |
17 } | 17 } |
18 | 18 |
19 namespace mus { | 19 namespace mus { |
20 class Window; | 20 class Window; |
21 } | 21 } |
22 | 22 |
23 namespace mash { | 23 namespace mash { |
24 namespace wm { | 24 namespace wm { |
25 | 25 |
26 class Shadow; | 26 class Shadow; |
27 | 27 |
28 // Utility functions to read values from properties & convert them to the | 28 // Utility functions to read values from properties & convert them to the |
29 // appropriate types. | 29 // appropriate types. |
30 | 30 |
31 void SetWindowShowState(mus::Window* window, mus::mojom::ShowState show_state); | 31 void SetWindowShowState(mus::Window* window, mus::mojom::ShowState show_state); |
32 mus::mojom::ShowState GetWindowShowState(const mus::Window* window); | 32 mus::mojom::ShowState GetWindowShowState(const mus::Window* window); |
33 | 33 |
34 void SetWindowUserSetBounds(mus::Window* window, const gfx::Rect& bounds); | 34 void SetWindowUserSetBounds(mus::Window* window, const gfx::Rect& bounds); |
35 gfx::Rect GetWindowUserSetBounds(const mus::Window* window); | 35 gfx::Rect GetWindowUserSetBounds(const mus::Window* window); |
36 | 36 |
37 void SetWindowPreferredSize(mus::Window* window, const gfx::Size& size); | 37 void SetWindowPreferredSize(mus::Window* window, const gfx::Size& size); |
38 gfx::Size GetWindowPreferredSize(const mus::Window* window); | 38 gfx::Size GetWindowPreferredSize(const mus::Window* window); |
39 | 39 |
40 mojom::Container GetRequestedContainer(const mus::Window* window); | 40 ash::mojom::Container GetRequestedContainer(const mus::Window* window); |
41 | 41 |
42 // Returns a bitfield of kResizeBehavior* values from | 42 // Returns a bitfield of kResizeBehavior* values from |
43 // window_manager_constants.mojom. | 43 // window_manager_constants.mojom. |
44 int32_t GetResizeBehavior(const mus::Window* window); | 44 int32_t GetResizeBehavior(const mus::Window* window); |
45 | 45 |
46 void SetRestoreBounds(mus::Window* window, const gfx::Rect& bounds); | 46 void SetRestoreBounds(mus::Window* window, const gfx::Rect& bounds); |
47 gfx::Rect GetRestoreBounds(const mus::Window* window); | 47 gfx::Rect GetRestoreBounds(const mus::Window* window); |
48 | 48 |
49 void SetShadow(mus::Window* window, Shadow* shadow); | 49 void SetShadow(mus::Window* window, Shadow* shadow); |
50 Shadow* GetShadow(const mus::Window* window); | 50 Shadow* GetShadow(const mus::Window* window); |
51 | 51 |
52 mus::mojom::WindowType GetWindowType(const mus::Window* window); | 52 mus::mojom::WindowType GetWindowType(const mus::Window* window); |
53 mus::mojom::WindowType GetWindowType( | 53 mus::mojom::WindowType GetWindowType( |
54 const mus::Window::SharedProperties& window); | 54 const mus::Window::SharedProperties& window); |
55 | 55 |
56 ui::wm::WindowType GetWmWindowType(const mus::Window* window); | 56 ui::wm::WindowType GetWmWindowType(const mus::Window* window); |
57 | 57 |
58 mojom::AshWindowType GetAshWindowType(const mus::Window* window); | 58 ash::mojom::AshWindowType GetAshWindowType(const mus::Window* window); |
59 | 59 |
60 base::string16 GetWindowTitle(const mus::Window* window); | 60 base::string16 GetWindowTitle(const mus::Window* window); |
61 | 61 |
62 mojo::Array<uint8_t> GetWindowAppIcon(const mus::Window* window); | 62 mojo::Array<uint8_t> GetWindowAppIcon(const mus::Window* window); |
63 | 63 |
64 void SetAppID(mus::Window* window, const base::string16& app_id); | 64 void SetAppID(mus::Window* window, const base::string16& app_id); |
65 base::string16 GetAppID(const mus::Window* window); | 65 base::string16 GetAppID(const mus::Window* window); |
66 | 66 |
67 bool GetWindowIgnoredByShelf(mus::Window* window); | 67 bool GetWindowIgnoredByShelf(mus::Window* window); |
68 | 68 |
69 void SetWindowIsJanky(mus::Window* window, bool janky); | 69 void SetWindowIsJanky(mus::Window* window, bool janky); |
70 bool IsWindowJanky(mus::Window* window); | 70 bool IsWindowJanky(mus::Window* window); |
71 bool IsWindowJankyProperty(const void* key); | 71 bool IsWindowJankyProperty(const void* key); |
72 | 72 |
73 void SetAlwaysOnTop(mus::Window* window, bool value); | 73 void SetAlwaysOnTop(mus::Window* window, bool value); |
74 bool IsAlwaysOnTop(mus::Window* window); | 74 bool IsAlwaysOnTop(mus::Window* window); |
75 | 75 |
76 } // namespace wm | 76 } // namespace wm |
77 } // namespace mash | 77 } // namespace mash |
78 | 78 |
79 #endif // MASH_WM_PROPERTY_UTIL_H_ | 79 #endif // MASH_WM_PROPERTY_UTIL_H_ |
OLD | NEW |