Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Unified Diff: ui/ozone/platform/x11/x11_window_host_manager.h

Issue 1602173005: Add PlatformWindow/Event related code for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small fixes. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698