Chromium Code Reviews| 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_HOST_MANAGER_H_ | |
| 6 #define UI_OZONE_PLATFORM_X11_X11_WINDOW_HOST_MANAGER_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 X11WindowHost; | |
| 20 using WindowStatusCallback = base::Callback<void(XID, X11WindowHost*)>; | |
| 21 | |
| 22 // Manages X11WindowHosts and holds map from XID to X11WindowHost. | |
| 23 class X11WindowHostManager : public base::RefCounted<X11WindowHostManager> { | |
|
spang
2016/01/20 19:53:31
X11WindowManager[Ozone] ?
kylechar
2016/01/20 21:46:16
Done.
| |
| 24 public: | |
| 25 X11WindowHostManager(); | |
| 26 | |
| 27 // Creates a new X11WindowHost. | |
| 28 scoped_ptr<X11WindowHost> CreatePlatformWindow( | |
| 29 PlatformWindowDelegate* delegate); | |
| 30 | |
| 31 // Returns the window that corresponds to the XID or nullptr if not found. | |
| 32 X11WindowHost* FindWindow(XID id); | |
| 33 | |
| 34 private: | |
| 35 friend class base::RefCounted<X11WindowHostManager>; | |
| 36 virtual ~X11WindowHostManager(); | |
| 37 | |
| 38 void OnWindowCreate(XID id, X11WindowHost* window); | |
| 39 void OnWindowDestroy(XID id, X11WindowHost* window); | |
| 40 | |
| 41 std::map<XID, X11WindowHost*> window_map_; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(X11WindowHostManager); | |
| 44 }; | |
| 45 | |
| 46 } // namespace ui | |
| 47 | |
| 48 #endif // UI_OZONE_PLATFORM_X11_X11_WINDOW_HOST_MANAGER_H_ | |
| OLD | NEW |