| 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 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "ui/aura/window_tree_host.h" | 14 #include "ui/aura/window_tree_host.h" |
| 15 #include "ui/base/cursor/cursor_loader_x11.h" | 15 #include "ui/base/cursor/cursor_loader_x11.h" |
| 16 #include "ui/events/event_source.h" | 16 #include "ui/events/event_source.h" |
| 17 #include "ui/events/platform/platform_event_dispatcher.h" | 17 #include "ui/events/platform/platform_event_dispatcher.h" |
| 18 #include "ui/gfx/insets.h" | 18 #include "ui/gfx/insets.h" |
| 19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| 20 #include "ui/gfx/x/x11_atom_cache.h" | 20 #include "ui/gfx/x/x11_atom_cache.h" |
| 21 #include "ui/views/views_export.h" | 21 #include "ui/views/views_export.h" |
| 22 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" | 22 #include "ui/views/widget/desktop_aura/desktop_window_tree_host.h" |
| 23 | 23 |
| 24 namespace gfx { | 24 namespace gfx { |
| 25 class ImageSkia; | 25 class ImageSkia; |
| 26 class ImageSkiaRep; | 26 class ImageSkiaRep; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace ui { |
| 30 class EventHandler; |
| 31 } |
| 32 |
| 29 namespace views { | 33 namespace views { |
| 30 class DesktopDragDropClientAuraX11; | 34 class DesktopDragDropClientAuraX11; |
| 31 class DesktopDispatcherClient; | 35 class DesktopDispatcherClient; |
| 32 class DesktopWindowTreeHostObserverX11; | 36 class DesktopWindowTreeHostObserverX11; |
| 33 class X11DesktopWindowMoveClient; | 37 class X11DesktopWindowMoveClient; |
| 34 class X11ScopedCapture; | 38 class X11ScopedCapture; |
| 35 class X11WindowEventFilter; | 39 class X11WindowEventFilter; |
| 36 | 40 |
| 37 class VIEWS_EXPORT DesktopWindowTreeHostX11 | 41 class VIEWS_EXPORT DesktopWindowTreeHostX11 |
| 38 : public DesktopWindowTreeHost, | 42 : public DesktopWindowTreeHost, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 67 // otherwise. | 71 // otherwise. |
| 68 ::Region GetWindowShape() const; | 72 ::Region GetWindowShape() const; |
| 69 | 73 |
| 70 // Called by X11DesktopHandler to notify us that the native windowing system | 74 // Called by X11DesktopHandler to notify us that the native windowing system |
| 71 // has changed our activation. | 75 // has changed our activation. |
| 72 void HandleNativeWidgetActivationChanged(bool active); | 76 void HandleNativeWidgetActivationChanged(bool active); |
| 73 | 77 |
| 74 void AddObserver(views::DesktopWindowTreeHostObserverX11* observer); | 78 void AddObserver(views::DesktopWindowTreeHostObserverX11* observer); |
| 75 void RemoveObserver(views::DesktopWindowTreeHostObserverX11* observer); | 79 void RemoveObserver(views::DesktopWindowTreeHostObserverX11* observer); |
| 76 | 80 |
| 81 // Swaps the current handler for events in the non client view with |handler|. |
| 82 void SwapNonClientEventHandler(scoped_ptr<ui::EventHandler> handler); |
| 83 |
| 77 // Deallocates the internal list of open windows. | 84 // Deallocates the internal list of open windows. |
| 78 static void CleanUpWindowList(); | 85 static void CleanUpWindowList(); |
| 79 | 86 |
| 80 protected: | 87 protected: |
| 81 // Overridden from DesktopWindowTreeHost: | 88 // Overridden from DesktopWindowTreeHost: |
| 82 virtual void Init(aura::Window* content_window, | 89 virtual void Init(aura::Window* content_window, |
| 83 const Widget::InitParams& params) OVERRIDE; | 90 const Widget::InitParams& params) OVERRIDE; |
| 84 virtual void OnNativeWidgetCreated(const Widget::InitParams& params) OVERRIDE; | 91 virtual void OnNativeWidgetCreated(const Widget::InitParams& params) OVERRIDE; |
| 85 virtual scoped_ptr<corewm::Tooltip> CreateTooltip() OVERRIDE; | 92 virtual scoped_ptr<corewm::Tooltip> CreateTooltip() OVERRIDE; |
| 86 virtual scoped_ptr<aura::client::DragDropClient> | 93 virtual scoped_ptr<aura::client::DragDropClient> |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 // Whether we used an ARGB visual for our window. | 274 // Whether we used an ARGB visual for our window. |
| 268 bool use_argb_visual_; | 275 bool use_argb_visual_; |
| 269 | 276 |
| 270 scoped_ptr<DesktopDispatcherClient> dispatcher_client_; | 277 scoped_ptr<DesktopDispatcherClient> dispatcher_client_; |
| 271 | 278 |
| 272 DesktopDragDropClientAuraX11* drag_drop_client_; | 279 DesktopDragDropClientAuraX11* drag_drop_client_; |
| 273 | 280 |
| 274 // Current Aura cursor. | 281 // Current Aura cursor. |
| 275 gfx::NativeCursor current_cursor_; | 282 gfx::NativeCursor current_cursor_; |
| 276 | 283 |
| 277 scoped_ptr<X11WindowEventFilter> x11_window_event_filter_; | 284 scoped_ptr<ui::EventHandler> x11_non_client_event_filter_; |
| 278 scoped_ptr<X11DesktopWindowMoveClient> x11_window_move_client_; | 285 scoped_ptr<X11DesktopWindowMoveClient> x11_window_move_client_; |
| 279 | 286 |
| 280 // TODO(beng): Consider providing an interface to DesktopNativeWidgetAura | 287 // TODO(beng): Consider providing an interface to DesktopNativeWidgetAura |
| 281 // instead of providing this route back to Widget. | 288 // instead of providing this route back to Widget. |
| 282 internal::NativeWidgetDelegate* native_widget_delegate_; | 289 internal::NativeWidgetDelegate* native_widget_delegate_; |
| 283 | 290 |
| 284 DesktopNativeWidgetAura* desktop_native_widget_aura_; | 291 DesktopNativeWidgetAura* desktop_native_widget_aura_; |
| 285 | 292 |
| 286 aura::Window* content_window_; | 293 aura::Window* content_window_; |
| 287 | 294 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 // attention to the window or completely ignore the hint. We stop flashing | 328 // attention to the window or completely ignore the hint. We stop flashing |
| 322 // the frame when |xwindow_| gains focus or handles a mouse button event. | 329 // the frame when |xwindow_| gains focus or handles a mouse button event. |
| 323 bool urgency_hint_set_; | 330 bool urgency_hint_set_; |
| 324 | 331 |
| 325 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); | 332 DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); |
| 326 }; | 333 }; |
| 327 | 334 |
| 328 } // namespace views | 335 } // namespace views |
| 329 | 336 |
| 330 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ | 337 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_WINDOW_TREE_HOST_X11_H_ |
| OLD | NEW |