Chromium Code Reviews| Index: ui/ozone/platform/x11/x11_window_manager_ozone.h |
| diff --git a/ui/ozone/platform/x11/x11_window_manager_ozone.h b/ui/ozone/platform/x11/x11_window_manager_ozone.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..72c898411e8e66f3048e84246fb9190ec498a3ba |
| --- /dev/null |
| +++ b/ui/ozone/platform/x11/x11_window_manager_ozone.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_MANAGER_OZONE_H_ |
| +#define UI_OZONE_PLATFORM_X11_X11_WINDOW_MANAGER_OZONE_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 X11WindowOzone; |
| +using WindowStatusCallback = base::Callback<void(XID, X11WindowOzone*)>; |
| + |
| +// Manages X11WindowOzones and holds map from XID to X11WindowOzone. |
| +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
|
| + public: |
| + X11WindowManagerOzone(); |
| + |
| + // Creates a new X11WindowOzone. |
| + scoped_ptr<X11WindowOzone> CreatePlatformWindow( |
| + PlatformWindowDelegate* delegate); |
| + |
| + // Returns the window that corresponds to the XID or nullptr if not found. |
| + X11WindowOzone* FindWindow(XID id); |
| + |
| + private: |
| + friend class base::RefCounted<X11WindowManagerOzone>; |
| + virtual ~X11WindowManagerOzone(); |
| + |
| + void OnWindowCreate(XID id, X11WindowOzone* window); |
| + void OnWindowDestroy(XID id, X11WindowOzone* window); |
| + |
| + std::map<XID, X11WindowOzone*> window_map_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(X11WindowManagerOzone); |
| +}; |
| + |
| +} // namespace ui |
| + |
| +#endif // UI_OZONE_PLATFORM_X11_X11_WINDOW_MANAGER_OZONE_H_ |