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

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: Cleanup 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
« no previous file with comments | « ui/views/widget/widget.cc ('k') | ui/views/widget/x11_desktop_window_move_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b0e910c61c5e8c8d76ec3b1709baf63556a4b45b
--- /dev/null
+++ b/ui/views/widget/x11_desktop_window_move_client.h
@@ -0,0 +1,55 @@
+// 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()?
+ bool in_move_loop_;
+
+ // Our cursor offset from the top left window origin when the drag
+ // started. Used to calculate the window's new bounds relative to the current
+ // location of the cursor.
+ gfx::Point window_offset_;
+
+ base::Closure quit_closure_;
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_WIDGET_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_
« no previous file with comments | « ui/views/widget/widget.cc ('k') | ui/views/widget/x11_desktop_window_move_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698