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 <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 9 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
10 #undef RootWindow | 10 #undef RootWindow |
11 | 11 |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "ui/aura/env_observer.h" | 14 #include "ui/aura/env_observer.h" |
| 15 #include "ui/aura/scoped_window_targeter.h" |
15 #include "ui/events/platform/platform_event_dispatcher.h" | 16 #include "ui/events/platform/platform_event_dispatcher.h" |
16 #include "ui/gfx/x/x11_atom_cache.h" | 17 #include "ui/gfx/x/x11_atom_cache.h" |
17 #include "ui/gfx/x/x11_types.h" | 18 #include "ui/gfx/x/x11_types.h" |
18 #include "ui/views/views_export.h" | 19 #include "ui/views/views_export.h" |
19 | 20 |
20 template <typename T> struct DefaultSingletonTraits; | 21 template <typename T> struct DefaultSingletonTraits; |
21 | 22 |
22 namespace views { | 23 namespace views { |
23 | 24 |
24 // A singleton that owns global objects related to the desktop and listens for | 25 // A singleton that owns global objects related to the desktop and listens for |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void ProcessXEvent(XEvent* event); | 58 void ProcessXEvent(XEvent* event); |
58 | 59 |
59 // ui::PlatformEventDispatcher | 60 // ui::PlatformEventDispatcher |
60 bool CanDispatchEvent(const ui::PlatformEvent& event) override; | 61 bool CanDispatchEvent(const ui::PlatformEvent& event) override; |
61 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; | 62 uint32_t DispatchEvent(const ui::PlatformEvent& event) override; |
62 | 63 |
63 // Overridden from aura::EnvObserver: | 64 // Overridden from aura::EnvObserver: |
64 void OnWindowInitialized(aura::Window* window) override; | 65 void OnWindowInitialized(aura::Window* window) override; |
65 void OnWillDestroyEnv() override; | 66 void OnWillDestroyEnv() override; |
66 | 67 |
| 68 // Make dialog modal. |
| 69 void SetModalDialog(XID dialog); |
| 70 |
67 private: | 71 private: |
68 enum ActiveState { | 72 enum ActiveState { |
69 ACTIVE, | 73 ACTIVE, |
70 NOT_ACTIVE | 74 NOT_ACTIVE |
71 }; | 75 }; |
72 | 76 |
73 X11DesktopHandler(); | 77 X11DesktopHandler(); |
74 ~X11DesktopHandler() override; | 78 ~X11DesktopHandler() override; |
75 | 79 |
76 // Handles changes in activation. | 80 // Handles changes in activation. |
(...skipping 17 matching lines...) Expand all Loading... |
94 ::Window current_window_; | 98 ::Window current_window_; |
95 | 99 |
96 // Whether we should treat |current_window_| as active. In particular, we | 100 // Whether we should treat |current_window_| as active. In particular, we |
97 // pretend that a window is deactivated after a call to DeactivateWindow(). | 101 // pretend that a window is deactivated after a call to DeactivateWindow(). |
98 ActiveState current_window_active_state_; | 102 ActiveState current_window_active_state_; |
99 | 103 |
100 ui::X11AtomCache atom_cache_; | 104 ui::X11AtomCache atom_cache_; |
101 | 105 |
102 bool wm_supports_active_window_; | 106 bool wm_supports_active_window_; |
103 | 107 |
| 108 XID modal_dialog_xid_; |
| 109 |
| 110 scoped_ptr<aura::ScopedWindowTargeter> scoped_targeter_; |
| 111 |
104 DISALLOW_COPY_AND_ASSIGN(X11DesktopHandler); | 112 DISALLOW_COPY_AND_ASSIGN(X11DesktopHandler); |
105 }; | 113 }; |
106 | 114 |
107 } // namespace views | 115 } // namespace views |
108 | 116 |
109 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ | 117 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ |
OLD | NEW |