Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: ui/views/widget/desktop_aura/desktop_root_window_host_wayland.h

Issue 17265006: wayland patch for inspection Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/views.gyp ('k') | ui/views/widget/desktop_aura/desktop_root_window_host_wayland.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_root_window_host_wayland.h
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.h b/ui/views/widget/desktop_aura/desktop_root_window_host_wayland.h
similarity index 71%
copy from ui/views/widget/desktop_aura/desktop_root_window_host_x11.h
copy to ui/views/widget/desktop_aura/desktop_root_window_host_wayland.h
index 8cd7aa3ba6e0a36bae220313702f7239fb143915..9e8eb76220ea22bbd5625adc566e45991ada3d7f 100644
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.h
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_wayland.h
@@ -2,21 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_X11_H_
-#define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_X11_H_
-
-#include <X11/Xlib.h>
-
-// Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
-#undef RootWindow
+#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_WAYLAND_H_
+#define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_WAYLAND_H_
#include "base/basictypes.h"
#include "base/memory/weak_ptr.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/root_window_host.h"
-#include "ui/base/cursor/cursor_loader_x11.h"
-#include "ui/base/dragdrop/desktop_selection_provider_aurax11.h"
-#include "ui/base/x/x11_atom_cache.h"
#include "ui/gfx/rect.h"
#include "ui/views/views_export.h"
#include "ui/views/widget/desktop_aura/desktop_root_window_host.h"
@@ -31,41 +23,34 @@ class ScreenPositionClient;
namespace views {
class DesktopActivationClient;
class DesktopCaptureClient;
-class DesktopDragDropClientAuraX11;
+class DesktopDragDropClientAuraWayland;
class DesktopDispatcherClient;
-class X11DesktopWindowMoveClient;
-class X11WindowEventFilter;
+class WaylandDesktopWindowMoveClient;
+class WaylandWindowEventFilter;
namespace corewm {
class CursorManager;
}
-class VIEWS_EXPORT DesktopRootWindowHostX11 :
+class VIEWS_EXPORT DesktopRootWindowHostWayland :
public DesktopRootWindowHost,
public aura::RootWindowHost,
- public ui::DesktopSelectionProviderAuraX11,
public base::MessageLoop::Dispatcher {
public:
- DesktopRootWindowHostX11(
+ DesktopRootWindowHostWayland(
internal::NativeWidgetDelegate* native_widget_delegate,
DesktopNativeWidgetAura* desktop_native_widget_aura,
- const gfx::Rect& initial_bounds);
- virtual ~DesktopRootWindowHostX11();
-
- // A way of converting an X11 |xid| host window into a |content_window_|.
- static aura::Window* GetContentWindowForXID(XID xid);
+ const gfx::Rect& bounds);
+ virtual ~DesktopRootWindowHostWayland();
- // A way of converting an X11 |xid| host window into this object.
- static DesktopRootWindowHostX11* GetHostForXID(XID xid);
-
- // Called by X11DesktopHandler to notify us that the native windowing system
+ // Called by WaylandDesktopHandler to notify us that the native windowing system
// has changed our activation.
void HandleNativeWidgetActivationChanged(bool active);
private:
- // Initializes our X11 surface to draw on. This method performs all
- // initialization related to talking to the X11 server.
- void InitX11Window(const Widget::InitParams& params);
+ // Initializes our Wayland surface to draw on. This method performs all
+ // initialization related to talking to the Wayland server.
+ void InitWaylandWindow(const Widget::InitParams& params);
// Creates an aura::RootWindow to contain the |content_window|, along with
// all aura client objects that direct behavior.
@@ -76,13 +61,6 @@ class VIEWS_EXPORT DesktopRootWindowHostX11 :
// detect that they're there.
bool IsWindowManagerPresent();
- // Sends a message to the x11 window manager, enabling or disabling the
- // states |state1| and |state2|.
- void SetWMSpecState(bool enabled, ::Atom state1, ::Atom state2);
-
- // Checks if the window manager has set a specific state.
- bool HasWMSpecProperty(const char* property) const;
-
// Called when another DRWHL takes capture, or when capture is released
// entirely.
void OnCaptureReleased();
@@ -168,40 +146,21 @@ class VIEWS_EXPORT DesktopRootWindowHostX11 :
virtual bool CopyAreaToSkCanvas(const gfx::Rect& source_bounds,
const gfx::Point& dest_offset,
SkCanvas* canvas) OVERRIDE;
+ virtual bool GrabSnapshot(
+ const gfx::Rect& snapshot_bounds,
+ std::vector<unsigned char>* png_representation) OVERRIDE;
virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE;
virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
virtual void PrepareForShutdown() OVERRIDE;
- // Overridden from DesktopSelectionProviderAuraX11:
- virtual void SetDropHandler(
- ui::OSExchangeDataProviderAuraX11* handler) OVERRIDE;
+ // Overridden from DesktopSelectionProviderAuraWayland:
+ //virtual void SetDropHandler(
+ // ui::OSExchangeDataProviderAuraWayland* handler) OVERRIDE;
// Overridden from Dispatcher:
virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
- base::WeakPtrFactory<DesktopRootWindowHostX11> close_widget_factory_;
-
- // X11 things
- // The display and the native X window hosting the root window.
- Display* xdisplay_;
- ::Window xwindow_;
-
- // The native root window.
- ::Window x_root_window_;
-
- ui::X11AtomCache atom_cache_;
-
- // Is the window mapped to the screen?
- bool window_mapped_;
-
- // The bounds of |xwindow_|.
- gfx::Rect bounds_;
-
- // True if the window should be focused when the window is shown.
- bool focus_when_shown_;
-
- // The window manager state bits.
- std::set< ::Atom> window_properties_;
+ base::WeakPtrFactory<DesktopRootWindowHostWayland> close_widget_factory_;
// We are owned by the RootWindow, but we have to have a back pointer to it.
aura::RootWindow* root_window_;
@@ -212,37 +171,33 @@ class VIEWS_EXPORT DesktopRootWindowHostX11 :
scoped_ptr<DesktopActivationClient> activation_client_;
scoped_ptr<views::corewm::CursorManager> cursor_client_;
scoped_ptr<DesktopDispatcherClient> dispatcher_client_;
- scoped_ptr<aura::client::ScreenPositionClient> position_client_;
- scoped_ptr<DesktopDragDropClientAuraX11> drag_drop_client_;
- // Current Aura cursor.
- gfx::NativeCursor current_cursor_;
+ internal::NativeWidgetDelegate* native_widget_delegate_;
- scoped_ptr<X11WindowEventFilter> x11_window_event_filter_;
- scoped_ptr<X11DesktopWindowMoveClient> x11_window_move_client_;
+ // The display and the native window hosting the root window.
+ ui::WaylandDisplay* display_;
+ ui::WaylandWindow* window_;
- // TODO(beng): Consider providing an interface to DesktopNativeWidgetAura
- // instead of providing this route back to Widget.
- internal::NativeWidgetDelegate* native_widget_delegate_;
+ // Is the window mapped to the screen?
+ bool window_mapped_;
- DesktopNativeWidgetAura* desktop_native_widget_aura_;
+ gfx::Rect bounds_;
aura::RootWindowHostDelegate* root_window_host_delegate_;
aura::Window* content_window_;
- // We forward drop related messages to this object.
- ui::OSExchangeDataProviderAuraX11* drop_handler_;
+ DesktopNativeWidgetAura* desktop_native_widget_aura_;
// The current root window host that has capture. While X11 has something
// like Windows SetCapture()/ReleaseCapture(), it is entirely implicit and
// there are no notifications when this changes. We need to track this so we
// can notify widgets when they have lost capture, which controls a bunch of
// things in views like hiding menus.
- static DesktopRootWindowHostX11* g_current_capture;
+ static DesktopRootWindowHostWayland* g_current_capture;
- DISALLOW_COPY_AND_ASSIGN(DesktopRootWindowHostX11);
+ DISALLOW_COPY_AND_ASSIGN(DesktopRootWindowHostWayland);
};
} // namespace views
-#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_X11_H_
+#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_ROOT_WINDOW_HOST_WAYLAND_H_
« no previous file with comments | « ui/views/views.gyp ('k') | ui/views/widget/desktop_aura/desktop_root_window_host_wayland.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698