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

Side by Side 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 unified diff | Download patch
OLDNEW
(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_MANAGER_OZONE_H_
6 #define UI_OZONE_PLATFORM_X11_X11_WINDOW_MANAGER_OZONE_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 X11WindowOzone;
20 using WindowStatusCallback = base::Callback<void(XID, X11WindowOzone*)>;
21
22 // Manages X11WindowOzones and holds map from XID to X11WindowOzone.
23 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
24 public:
25 X11WindowManagerOzone();
26
27 // Creates a new X11WindowOzone.
28 scoped_ptr<X11WindowOzone> CreatePlatformWindow(
29 PlatformWindowDelegate* delegate);
30
31 // Returns the window that corresponds to the XID or nullptr if not found.
32 X11WindowOzone* FindWindow(XID id);
33
34 private:
35 friend class base::RefCounted<X11WindowManagerOzone>;
36 virtual ~X11WindowManagerOzone();
37
38 void OnWindowCreate(XID id, X11WindowOzone* window);
39 void OnWindowDestroy(XID id, X11WindowOzone* window);
40
41 std::map<XID, X11WindowOzone*> window_map_;
42
43 DISALLOW_COPY_AND_ASSIGN(X11WindowManagerOzone);
44 };
45
46 } // namespace ui
47
48 #endif // UI_OZONE_PLATFORM_X11_X11_WINDOW_MANAGER_OZONE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698