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_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
7 | 7 |
8 #include <X11/extensions/shape.h> | 8 #include <X11/extensions/shape.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #include <X11/Xutil.h> | 10 #include <X11/Xutil.h> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/cancelable_callback.h" | 13 #include "base/cancelable_callback.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "ui/aura/window_tree_host.h" | 16 #include "ui/aura/window_tree_host.h" |
17 #include "ui/base/cursor/cursor_loader_x11.h" | 17 #include "ui/base/cursor/cursor_loader_x11.h" |
18 #include "ui/events/event_source.h" | |
19 #include "ui/events/platform/platform_event_dispatcher.h" | 18 #include "ui/events/platform/platform_event_dispatcher.h" |
20 #include "ui/gfx/geometry/insets.h" | 19 #include "ui/gfx/geometry/insets.h" |
21 #include "ui/gfx/geometry/rect.h" | 20 #include "ui/gfx/geometry/rect.h" |
22 #include "ui/gfx/geometry/size.h" | 21 #include "ui/gfx/geometry/size.h" |
23 #include "ui/gfx/x/x11_atom_cache.h" | 22 #include "ui/gfx/x/x11_atom_cache.h" |
24 #include "ui/views/views_export.h" | 23 #include "ui/views/views_export.h" |
25 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" | 24 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" |
26 | 25 |
27 namespace gfx { | 26 namespace gfx { |
28 class ImageSkia; | 27 class ImageSkia; |
29 class ImageSkiaRep; | 28 class ImageSkiaRep; |
30 } | 29 } |
31 | 30 |
32 namespace ui { | 31 namespace ui { |
33 class EventHandler; | 32 class EventHandler; |
34 } | 33 } |
35 | 34 |
36 namespace views { | 35 namespace views { |
37 class DesktopDragDropClientAuraX11; | 36 class DesktopDragDropClientAuraX11; |
38 class DesktopDispatcherClient; | 37 class DesktopDispatcherClient; |
39 class DesktopWindowTreeHostObserverX11; | 38 class DesktopWindowTreeHostObserverX11; |
40 class X11DesktopWindowMoveClient; | 39 class X11DesktopWindowMoveClient; |
41 class X11WindowEventFilter; | 40 class X11WindowEventFilter; |
42 | 41 |
43 class VIEWS_EXPORT DesktopWindowTreeHostX11 | 42 class VIEWS_EXPORT DesktopWindowTreeHostX11 |
44 : public DesktopWindowTreeHost, | 43 : public DesktopWindowTreeHost, |
45 public aura::WindowTreeHost, | 44 public aura::WindowTreeHost, |
46 public ui::EventSource, | |
47 public ui::PlatformEventDispatcher { | 45 public ui::PlatformEventDispatcher { |
48 public: | 46 public: |
49 DesktopWindowTreeHostX11( | 47 DesktopWindowTreeHostX11( |
50 internal::NativeWidgetDelegate* native_widget_delegate, | 48 internal::NativeWidgetDelegate* native_widget_delegate, |
51 DesktopNativeWidgetAura* desktop_native_widget_aura); | 49 DesktopNativeWidgetAura* desktop_native_widget_aura); |
52 ~DesktopWindowTreeHostX11() override; | 50 ~DesktopWindowTreeHostX11() override; |
53 | 51 |
54 // A way of converting an X11 |xid| host window into a |content_window_|. | 52 // A way of converting an X11 |xid| host window into a |content_window_|. |
55 static aura::Window* GetContentWindowForXID(XID xid); | 53 static aura::Window* GetContentWindowForXID(XID xid); |
56 | 54 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 void HideImpl() override; | 153 void HideImpl() override; |
156 gfx::Rect GetBounds() const override; | 154 gfx::Rect GetBounds() const override; |
157 void SetBounds(const gfx::Rect& requested_bounds_in_pixels) override; | 155 void SetBounds(const gfx::Rect& requested_bounds_in_pixels) override; |
158 gfx::Point GetLocationOnNativeScreen() const override; | 156 gfx::Point GetLocationOnNativeScreen() const override; |
159 void SetCapture() override; | 157 void SetCapture() override; |
160 void ReleaseCapture() override; | 158 void ReleaseCapture() override; |
161 void SetCursorNative(gfx::NativeCursor cursor) override; | 159 void SetCursorNative(gfx::NativeCursor cursor) override; |
162 void MoveCursorToNative(const gfx::Point& location) override; | 160 void MoveCursorToNative(const gfx::Point& location) override; |
163 void OnCursorVisibilityChangedNative(bool show) override; | 161 void OnCursorVisibilityChangedNative(bool show) override; |
164 | 162 |
165 // Overridden frm ui::EventSource | |
166 ui::EventProcessor* GetEventProcessor() override; | |
167 | |
168 private: | 163 private: |
169 friend class DesktopWindowTreeHostX11HighDPITest; | 164 friend class DesktopWindowTreeHostX11HighDPITest; |
170 // Initializes our X11 surface to draw on. This method performs all | 165 // Initializes our X11 surface to draw on. This method performs all |
171 // initialization related to talking to the X11 server. | 166 // initialization related to talking to the X11 server. |
172 void InitX11Window(const Widget::InitParams& params); | 167 void InitX11Window(const Widget::InitParams& params); |
173 | 168 |
174 // Creates an aura::WindowEventDispatcher to contain the |content_window|, | 169 // Creates an aura::WindowEventDispatcher to contain the |content_window|, |
175 // along with all aura client objects that direct behavior. | 170 // along with all aura client objects that direct behavior. |
176 aura::WindowEventDispatcher* InitDispatcher(const Widget::InitParams& params); | 171 aura::WindowEventDispatcher* InitDispatcher(const Widget::InitParams& params); |
177 | 172 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 base::CancelableCallback<void()> delayed_resize_task_; | 345 base::CancelableCallback<void()> delayed_resize_task_; |
351 | 346 |
352 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; | 347 base::WeakPtrFactory<DesktopWindowTreeHostX11> close_widget_factory_; |
353 | 348 |
354 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); | 349 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); |
355 }; | 350 }; |
356 | 351 |
357 } // namespace views | 352 } // namespace views |
358 | 353 |
359 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 354 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
OLD | NEW |