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

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

Issue 1602173005: Add PlatformWindow/Event related code for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes for comments from spang. 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_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_

Powered by Google App Engine
This is Rietveld 408576698