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

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

Issue 262893002: Removes grab input window and extra grab and ungrab in X11WholeScreenMoveLoop Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removes grab input window and extra grab and ungrab in X11WholeScreenMoveLoop (nits and comments) Created 6 years, 7 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
Index: ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h
index d4092489154ac5c4c79764bf35918fd3ddabb141..bc5c1186e1837461bb34074e24a149637631a80f 100644
--- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h
+++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h
@@ -16,6 +16,7 @@
#include "ui/base/cursor/cursor.h"
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/gfx/point.h"
+#include "ui/gfx/rect.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/views/views_export.h"
#include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h"
@@ -42,6 +43,7 @@ class SelectionFormatMap;
namespace views {
class DesktopNativeCursorManager;
+class Widget;
// Implements drag and drop on X11 for aura. On one side, this class takes raw
// X11 events forwarded from DesktopWindowTreeHostLinux, while on the other, it
@@ -153,6 +155,9 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11
// server.
ui::SelectionFormatMap GetFormatMap() const;
+ // Updates the cursor by re-grabbing the pointer while in the move loop.
+ void UpdateCursor();
+
// Handling XdndPosition can be paused while waiting for more data; this is
// called either synchronously from OnXdndPosition, or asynchronously after
// we've received data requested from the other window.
@@ -170,6 +175,12 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11
// server.
void SendXClientEvent(::Window xid, XEvent* xev);
+ // Sets an image to be used during the drag.
+ void SetDragImage(const gfx::ImageSkia& image, gfx::Vector2dF offset);
sadrul 2014/05/23 14:39:53 const gfx::Vector2dF&
varkha 2014/05/23 15:38:36 Done.
+
+ // Creates a window to show the drag image during the drag.
+ void CreateDragImageWindow();
+
// A nested message loop that notifies this object of events through the
// X11WholeScreenMoveLoopDelegate interface.
X11WholeScreenMoveLoop move_loop_;
@@ -245,6 +256,15 @@ class VIEWS_EXPORT DesktopDragDropClientAuraX11
gfx::NativeCursor copy_grab_cursor_;
gfx::NativeCursor move_grab_cursor_;
+ // A Widget is created during the drag.
+ scoped_ptr<Widget> drag_widget_;
+ gfx::ImageSkia drag_image_;
+ gfx::Vector2dF drag_offset_;
+
+ // Drag widget is positioned off screen when drag image is not set or is
+ // completely transparent.
+ gfx::Rect null_drag_widget_bounds_;
+
base::WeakPtrFactory<DesktopDragDropClientAuraX11> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(DesktopDragDropClientAuraX11);

Powered by Google App Engine
This is Rietveld 408576698