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

Unified Diff: ui/views/widget/x11_desktop_window_move_client.h

Issue 10828133: Desktop Aura: Allow tab drags out of window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better mouse tracking Created 8 years, 4 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/x11_desktop_window_move_client.h
diff --git a/ui/views/widget/x11_desktop_window_move_client.h b/ui/views/widget/x11_desktop_window_move_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..92f6a4e18f0e67aa1aeb72563ec040186480d77d
--- /dev/null
+++ b/ui/views/widget/x11_desktop_window_move_client.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_WIDGET_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_
+#define UI_VIEWS_WIDGET_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_
+
+#include "base/callback.h"
+#include "base/compiler_specific.h"
+#include "ui/aura/client/window_move_client.h"
+#include "ui/aura/event_filter.h"
+#include "ui/views/views_export.h"
+#include "ui/gfx/point.h"
+
+namespace views {
+
+// When we're dragging tabs, we need to manually position our window.
+class VIEWS_EXPORT X11DesktopWindowMoveClient
+ : public aura::EventFilter,
+ public aura::client::WindowMoveClient {
+ public:
+ X11DesktopWindowMoveClient();
+ virtual ~X11DesktopWindowMoveClient();
+
+ // Overridden from aura::EventFilter:
+ virtual bool PreHandleKeyEvent(aura::Window* target,
+ ui::KeyEvent* event) OVERRIDE;
+ virtual bool PreHandleMouseEvent(aura::Window* target,
+ ui::MouseEvent* event) OVERRIDE;
+ virtual ui::TouchStatus PreHandleTouchEvent(aura::Window* target,
+ ui::TouchEvent* event) OVERRIDE;
+ virtual ui::GestureStatus PreHandleGestureEvent(
+ aura::Window* target,
+ ui::GestureEvent* event) OVERRIDE;
+
+ // Overridden from aura::client::WindowMoveClient:
+ virtual void RunMoveLoop(aura::Window* window,
+ const gfx::Point& drag_offset) OVERRIDE;
+ virtual void EndMoveLoop() OVERRIDE;
+
+ private:
+ // Are we running a nested message loop from RunMoveLoop().
Daniel Erat 2012/08/15 20:30:57 nit: s/\./?/
+ bool in_move_loop_;
+
+ // Our cursor offset on first invocation.
Daniel Erat 2012/08/15 20:30:57 what's it an offset from, the target window's orig
+ gfx::Point window_offset_;
+
+ base::Closure quit_closure_;
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_WIDGET_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698