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

Side by Side Diff: ui/views/widget/x11_desktop_window_move_client.h

Issue 11369220: Move the desktop aura classes into a desktop subdir to make the gyp simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_WIDGET_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_
6 #define UI_VIEWS_WIDGET_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_
7
8 #include <X11/Xlib.h>
9
10 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
11 #undef RootWindow
12
13 #include "base/callback.h"
14 #include "base/compiler_specific.h"
15 #include "base/message_loop.h"
16 #include "ui/aura/client/window_move_client.h"
17 #include "ui/aura/event_filter.h"
18 #include "ui/views/views_export.h"
19 #include "ui/gfx/point.h"
20
21 namespace aura {
22 class RootWindow;
23 }
24
25 namespace views {
26
27 // When we're dragging tabs, we need to manually position our window.
28 class VIEWS_EXPORT X11DesktopWindowMoveClient
29 : public MessageLoop::Dispatcher,
30 public aura::client::WindowMoveClient {
31 public:
32 X11DesktopWindowMoveClient();
33 virtual ~X11DesktopWindowMoveClient();
34
35 // Overridden from MessageLoop::Dispatcher:
36 virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
37
38 // Overridden from aura::client::WindowMoveClient:
39 virtual aura::client::WindowMoveResult RunMoveLoop(
40 aura::Window* window,
41 const gfx::Vector2d& drag_offset) OVERRIDE;
42 virtual void EndMoveLoop() OVERRIDE;
43
44 private:
45 // Are we running a nested message loop from RunMoveLoop()?
46 bool in_move_loop_;
47
48 // An invisible InputOnly window . We create this window so we can track the
49 // cursor wherever it goes on screen during a drag, since normal windows
50 // don't receive pointer motion events outside of their bounds.
51 ::Window grab_input_window_;
52
53 // We need to keep track of this so we can actually move it when reacting to
54 // events from |grab_input_window_| during Dispatch().
55 aura::RootWindow* root_window_;
56
57 // Our cursor offset from the top left window origin when the drag
58 // started. Used to calculate the window's new bounds relative to the current
59 // location of the cursor.
60 gfx::Vector2d window_offset_;
61
62 base::Closure quit_closure_;
63 };
64
65 } // namespace views
66
67 #endif // UI_VIEWS_WIDGET_X11_DESKTOP_WINDOW_MOVE_CLIENT_H_
OLDNEW
« no previous file with comments | « ui/views/widget/x11_desktop_handler.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