| 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_ROOT_WINDOW_HOST_X11_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_X11_H_ |
| 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_X11_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_X11_H_ |
| 7 | 7 |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 | 9 |
| 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 "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "ui/aura/client/cursor_client.h" | 15 #include "ui/aura/client/cursor_client.h" |
| 16 #include "ui/aura/root_window_host.h" | 16 #include "ui/aura/root_window_host.h" |
| 17 #include "ui/base/cursor/cursor_loader_x11.h" | 17 #include "ui/base/cursor/cursor_loader_x11.h" |
| 18 #include "ui/base/dragdrop/desktop_selection_provider_aurax11.h" | |
| 19 #include "ui/base/x/x11_atom_cache.h" | 18 #include "ui/base/x/x11_atom_cache.h" |
| 20 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| 21 #include "ui/views/views_export.h" | 20 #include "ui/views/views_export.h" |
| 22 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" | 21 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" |
| 23 | 22 |
| 24 namespace aura { | 23 namespace aura { |
| 25 namespace client { | 24 namespace client { |
| 26 class FocusClient; | 25 class FocusClient; |
| 27 class ScreenPositionClient; | 26 class ScreenPositionClient; |
| 28 } | 27 } |
| 29 } | 28 } |
| 30 | 29 |
| 31 namespace views { | 30 namespace views { |
| 32 class DesktopActivationClient; | 31 class DesktopActivationClient; |
| 33 class DesktopCaptureClient; | 32 class DesktopCaptureClient; |
| 34 class DesktopDragDropClientAuraX11; | 33 class DesktopDragDropClientAuraX11; |
| 35 class DesktopDispatcherClient; | 34 class DesktopDispatcherClient; |
| 36 class X11DesktopWindowMoveClient; | 35 class X11DesktopWindowMoveClient; |
| 37 class X11WindowEventFilter; | 36 class X11WindowEventFilter; |
| 38 | 37 |
| 39 namespace corewm { | 38 namespace corewm { |
| 40 class CursorManager; | 39 class CursorManager; |
| 41 } | 40 } |
| 42 | 41 |
| 43 class VIEWS_EXPORT DesktopRootWindowHostX11 : | 42 class VIEWS_EXPORT DesktopRootWindowHostX11 : |
| 44 public DesktopRootWindowHost, | 43 public DesktopRootWindowHost, |
| 45 public aura::RootWindowHost, | 44 public aura::RootWindowHost, |
| 46 public ui::DesktopSelectionProviderAuraX11, | |
| 47 public base::MessageLoop::Dispatcher { | 45 public base::MessageLoop::Dispatcher { |
| 48 public: | 46 public: |
| 49 DesktopRootWindowHostX11( | 47 DesktopRootWindowHostX11( |
| 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 const gfx::Rect& initial_bounds); | 50 const gfx::Rect& initial_bounds); |
| 53 virtual ~DesktopRootWindowHostX11(); | 51 virtual ~DesktopRootWindowHostX11(); |
| 54 | 52 |
| 55 // A way of converting an X11 |xid| host window into a |content_window_|. | 53 // A way of converting an X11 |xid| host window into a |content_window_|. |
| 56 static aura::Window* GetContentWindowForXID(XID xid); | 54 static aura::Window* GetContentWindowForXID(XID xid); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; | 163 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; |
| 166 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; | 164 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; |
| 167 virtual void SetFocusWhenShown(bool focus_when_shown) OVERRIDE; | 165 virtual void SetFocusWhenShown(bool focus_when_shown) OVERRIDE; |
| 168 virtual bool CopyAreaToSkCanvas(const gfx::Rect& source_bounds, | 166 virtual bool CopyAreaToSkCanvas(const gfx::Rect& source_bounds, |
| 169 const gfx::Point& dest_offset, | 167 const gfx::Point& dest_offset, |
| 170 SkCanvas* canvas) OVERRIDE; | 168 SkCanvas* canvas) OVERRIDE; |
| 171 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; | 169 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; |
| 172 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 170 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
| 173 virtual void PrepareForShutdown() OVERRIDE; | 171 virtual void PrepareForShutdown() OVERRIDE; |
| 174 | 172 |
| 175 // Overridden from DesktopSelectionProviderAuraX11: | |
| 176 virtual void SetDropHandler( | |
| 177 ui::OSExchangeDataProviderAuraX11* handler) OVERRIDE; | |
| 178 | |
| 179 // Overridden from Dispatcher: | 173 // Overridden from Dispatcher: |
| 180 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; | 174 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE; |
| 181 | 175 |
| 182 base::WeakPtrFactory<DesktopRootWindowHostX11> close_widget_factory_; | 176 base::WeakPtrFactory<DesktopRootWindowHostX11> close_widget_factory_; |
| 183 | 177 |
| 184 // X11 things | 178 // X11 things |
| 185 // The display and the native X window hosting the root window. | 179 // The display and the native X window hosting the root window. |
| 186 Display* xdisplay_; | 180 Display* xdisplay_; |
| 187 ::Window xwindow_; | 181 ::Window xwindow_; |
| 188 | 182 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 217 |
| 224 // TODO(beng): Consider providing an interface to DesktopNativeWidgetAura | 218 // TODO(beng): Consider providing an interface to DesktopNativeWidgetAura |
| 225 // instead of providing this route back to Widget. | 219 // instead of providing this route back to Widget. |
| 226 internal::NativeWidgetDelegate* native_widget_delegate_; | 220 internal::NativeWidgetDelegate* native_widget_delegate_; |
| 227 | 221 |
| 228 DesktopNativeWidgetAura* desktop_native_widget_aura_; | 222 DesktopNativeWidgetAura* desktop_native_widget_aura_; |
| 229 | 223 |
| 230 aura::RootWindowHostDelegate* root_window_host_delegate_; | 224 aura::RootWindowHostDelegate* root_window_host_delegate_; |
| 231 aura::Window* content_window_; | 225 aura::Window* content_window_; |
| 232 | 226 |
| 233 // We forward drop related messages to this object. | |
| 234 ui::OSExchangeDataProviderAuraX11* drop_handler_; | |
| 235 | |
| 236 // The current root window host that has capture. While X11 has something | 227 // The current root window host that has capture. While X11 has something |
| 237 // like Windows SetCapture()/ReleaseCapture(), it is entirely implicit and | 228 // like Windows SetCapture()/ReleaseCapture(), it is entirely implicit and |
| 238 // there are no notifications when this changes. We need to track this so we | 229 // there are no notifications when this changes. We need to track this so we |
| 239 // can notify widgets when they have lost capture, which controls a bunch of | 230 // can notify widgets when they have lost capture, which controls a bunch of |
| 240 // things in views like hiding menus. | 231 // things in views like hiding menus. |
| 241 static DesktopRootWindowHostX11* g_current_capture; | 232 static DesktopRootWindowHostX11* g_current_capture; |
| 242 | 233 |
| 243 DISALLOW_COPY_AND_ASSIGN(DesktopRootWindowHostX11); | 234 DISALLOW_COPY_AND_ASSIGN(DesktopRootWindowHostX11); |
| 244 }; | 235 }; |
| 245 | 236 |
| 246 } // namespace views | 237 } // namespace views |
| 247 | 238 |
| 248 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_X11_H_ | 239 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_X11_H_ |
| OLD | NEW |