OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_H_ | 5 #ifndef CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_H_ |
6 #define CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_H_ | 6 #define CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 | 12 |
13 namespace chromecast { | 13 namespace chromecast { |
14 | 14 |
15 // Chromecast's window-manager interface. | 15 // Chromecast's window-manager interface. |
16 // This declares the interface to add top-level windows to the Chromecast | 16 // This declares the interface to add top-level windows to the Chromecast |
17 // platform window. It is owned by the UI thread, and generally one instance | 17 // platform window. It is owned by the UI thread, and generally one instance |
18 // should exist per platform root window (e.g., in Ozone, one per Ozone window). | 18 // should exist per platform root window (e.g., in Ozone, one per Ozone window). |
19 class CastWindowManager { | 19 class CastWindowManager { |
20 public: | 20 public: |
21 // Note: these window IDs are ordered by z-order. | |
22 enum { | |
derekjchow1
2017/01/19 18:12:13
Where is this enum actually used?
Joshua LeVasseur
2017/01/19 19:35:25
Pending CLs and internal code.
| |
23 BOTTOM = -1, | |
24 APP = BOTTOM, | |
derekjchow1
2017/01/19 18:12:13
To mimic line TOP = VOLUME, shouldn't BOTTOM = APP
Joshua LeVasseur
2017/01/19 19:35:25
That would require APP to be defined first at -1 (
| |
25 DEBUG_OVERLAY, | |
26 INFO_OVERLAY, | |
27 SOFT_KEYBOARD, | |
28 VOLUME, | |
29 TOP = VOLUME | |
30 } WindowId; | |
31 | |
21 // Creates the platform-specific CastWindowManager. | 32 // Creates the platform-specific CastWindowManager. |
22 static std::unique_ptr<CastWindowManager> Create(bool enable_input); | 33 static std::unique_ptr<CastWindowManager> Create(bool enable_input); |
23 | 34 |
24 virtual ~CastWindowManager() {} | 35 virtual ~CastWindowManager() {} |
25 | 36 |
26 // Remove all windows and release all graphics resources. | 37 // Remove all windows and release all graphics resources. |
27 // Can be called multiple times. | 38 // Can be called multiple times. |
28 virtual void TearDown() = 0; | 39 virtual void TearDown() = 0; |
29 | 40 |
30 // Adds a window to the window manager. | 41 // Adds a window to the window manager. |
31 // This doesn't necessarily make the window visible. | 42 // This doesn't necessarily make the window visible. |
32 // If the window manager hasn't been initialized, this has the side effect of | 43 // If the window manager hasn't been initialized, this has the side effect of |
33 // causing it to initialize. | 44 // causing it to initialize. |
34 virtual void AddWindow(gfx::NativeView window) = 0; | 45 virtual void AddWindow(gfx::NativeView window) = 0; |
35 }; | 46 }; |
36 | 47 |
37 } // namespace chromecast | 48 } // namespace chromecast |
38 | 49 |
39 #endif // CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_H_ | 50 #endif // CHROMECAST_GRAPHICS_CAST_WINDOW_MANAGER_H_ |
OLD | NEW |