OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
11 #undef RootWindow | 11 #undef RootWindow |
12 | 12 |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "ui/aura/env_observer.h" | 16 #include "ui/aura/env_observer.h" |
| 17 #include "ui/display/desktop.h" |
17 #include "ui/events/platform/platform_event_dispatcher.h" | 18 #include "ui/events/platform/platform_event_dispatcher.h" |
18 #include "ui/events/platform/x11/x11_event_source.h" | 19 #include "ui/events/platform/x11/x11_event_source.h" |
19 #include "ui/gfx/x/x11_atom_cache.h" | 20 #include "ui/gfx/x/x11_atom_cache.h" |
20 #include "ui/gfx/x/x11_types.h" | 21 #include "ui/gfx/x/x11_types.h" |
21 #include "ui/views/views_export.h" | 22 #include "ui/views/views_export.h" |
22 | 23 |
23 namespace base { | 24 namespace base { |
24 template <typename T> struct DefaultSingletonTraits; | 25 template <typename T> struct DefaultSingletonTraits; |
25 } | 26 } |
26 | 27 |
27 namespace views { | 28 namespace views { |
28 | 29 |
29 // A singleton that owns global objects related to the desktop and listens for | 30 // A singleton that owns global objects related to the desktop and listens for |
30 // X11 events on the X11 root window. Destroys itself when aura::Env is | 31 // X11 events on the X11 root window. Destroys itself when aura::Env is |
31 // deleted. | 32 // deleted. |
32 class VIEWS_EXPORT X11DesktopHandler : public ui::PlatformEventDispatcher, | 33 class VIEWS_EXPORT X11DesktopHandler : public ui::PlatformEventDispatcher, |
33 public aura::EnvObserver { | 34 public aura::EnvObserver, |
| 35 public display::Desktop { |
34 public: | 36 public: |
35 // Returns the singleton handler. | 37 // Returns the singleton handler. |
36 static X11DesktopHandler* get(); | 38 static X11DesktopHandler* get(); |
37 | 39 |
38 // Gets/sets the X11 server time of the most recent mouse click, touch or | 40 // Gets/sets the X11 server time of the most recent mouse click, touch or |
39 // key press on a Chrome window. | 41 // key press on a Chrome window. |
40 int wm_user_time_ms() const { return wm_user_time_ms_; } | 42 int wm_user_time_ms() const { return wm_user_time_ms_; } |
41 void set_wm_user_time_ms(Time time_ms); | 43 void set_wm_user_time_ms(Time time_ms); |
42 | 44 |
43 // Sends a request to the window manager to activate |window|. | 45 // Sends a request to the window manager to activate |window|. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 ui::X11AtomCache atom_cache_; | 106 ui::X11AtomCache atom_cache_; |
105 | 107 |
106 bool wm_supports_active_window_; | 108 bool wm_supports_active_window_; |
107 | 109 |
108 DISALLOW_COPY_AND_ASSIGN(X11DesktopHandler); | 110 DISALLOW_COPY_AND_ASSIGN(X11DesktopHandler); |
109 }; | 111 }; |
110 | 112 |
111 } // namespace views | 113 } // namespace views |
112 | 114 |
113 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ | 115 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ |
OLD | NEW |