OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_OZONE_PLATFORM_X11_X11_WINDOW_MANAGER_OZONE_H_ | |
6 #define UI_OZONE_PLATFORM_X11_X11_WINDOW_MANAGER_OZONE_H_ | |
7 | |
8 #include <map> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/macros.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 | |
14 typedef unsigned long XID; | |
15 | |
16 namespace ui { | |
17 | |
18 class PlatformWindowDelegate; | |
19 class X11WindowOzone; | |
20 using WindowStatusCallback = base::Callback<void(XID, X11WindowOzone*)>; | |
21 | |
22 // Manages X11WindowOzones and holds map from XID to X11WindowOzone. | |
23 class X11WindowManagerOzone : public base::RefCounted<X11WindowManagerOzone> { | |
sadrul
2016/01/21 14:53:01
Why does this need to be refcounted?
kylechar
2016/01/26 15:24:25
For the callbacks. I think X11WindowManagerOzone s
| |
24 public: | |
25 X11WindowManagerOzone(); | |
26 | |
27 // Creates a new X11WindowOzone. | |
28 scoped_ptr<X11WindowOzone> CreatePlatformWindow( | |
29 PlatformWindowDelegate* delegate); | |
30 | |
31 // Returns the window that corresponds to the XID or nullptr if not found. | |
32 X11WindowOzone* FindWindow(XID id); | |
33 | |
34 private: | |
35 friend class base::RefCounted<X11WindowManagerOzone>; | |
36 virtual ~X11WindowManagerOzone(); | |
37 | |
38 void OnWindowCreate(XID id, X11WindowOzone* window); | |
39 void OnWindowDestroy(XID id, X11WindowOzone* window); | |
40 | |
41 std::map<XID, X11WindowOzone*> window_map_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(X11WindowManagerOzone); | |
44 }; | |
45 | |
46 } // namespace ui | |
47 | |
48 #endif // UI_OZONE_PLATFORM_X11_X11_WINDOW_MANAGER_OZONE_H_ | |
OLD | NEW |