Chromium Code Reviews| Index: ui/ozone/platform/x11/x11_window_host_manager.h |
| diff --git a/ui/ozone/platform/x11/x11_window_host_manager.h b/ui/ozone/platform/x11/x11_window_host_manager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fb2ffc22771db21ef0a12e4ca3021056ee7cb432 |
| --- /dev/null |
| +++ b/ui/ozone/platform/x11/x11_window_host_manager.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_OZONE_PLATFORM_X11_X11_WINDOW_HOST_MANAGER_H_ |
| +#define UI_OZONE_PLATFORM_X11_X11_WINDOW_HOST_MANAGER_H_ |
| + |
| +#include <map> |
| + |
| +#include "base/callback.h" |
| +#include "base/macros.h" |
| +#include "base/memory/scoped_ptr.h" |
| + |
| +typedef unsigned long XID; |
| + |
| +namespace ui { |
| + |
| +class PlatformWindowDelegate; |
| +class X11WindowHost; |
| +using WindowStatusCallback = base::Callback<void(XID, X11WindowHost*)>; |
| + |
| +// Manages X11WindowHosts and holds map from XID to X11WindowHost. |
| +class X11WindowHostManager : public base::RefCounted<X11WindowHostManager> { |
|
spang
2016/01/20 19:53:31
X11WindowManager[Ozone] ?
kylechar
2016/01/20 21:46:16
Done.
|
| + public: |
| + X11WindowHostManager(); |
| + |
| + // Creates a new X11WindowHost. |
| + scoped_ptr<X11WindowHost> CreatePlatformWindow( |
| + PlatformWindowDelegate* delegate); |
| + |
| + // Returns the window that corresponds to the XID or nullptr if not found. |
| + X11WindowHost* FindWindow(XID id); |
| + |
| + private: |
| + friend class base::RefCounted<X11WindowHostManager>; |
| + virtual ~X11WindowHostManager(); |
| + |
| + void OnWindowCreate(XID id, X11WindowHost* window); |
| + void OnWindowDestroy(XID id, X11WindowHost* window); |
| + |
| + std::map<XID, X11WindowHost*> window_map_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(X11WindowHostManager); |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // UI_OZONE_PLATFORM_X11_X11_WINDOW_HOST_MANAGER_H_ |