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

Side by Side Diff: ash/wm/drag_window_resizer.h

Issue 11411344: Extract the code for supporing extended desktop from WorkspaceWindowResizer into DragWindowResizer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 ASH_WM_DRAG_WINDOW_RESIZER_H_
6 #define ASH_WM_DRAG_WINDOW_RESIZER_H_
7
8 #include "ash/wm/window_resizer.h"
9 #include "base/compiler_specific.h"
10 #include "base/gtest_prod_util.h"
11 #include "ui/gfx/point.h"
12
13 namespace ash {
14 namespace internal {
15
16 class DragWindowController;
17
18 // DragWindowResizer is a decorator of WindowResizer and adds the ability to
19 // drag windows across displays.
20 class ASH_EXPORT DragWindowResizer : public WindowResizer {
21 public:
22 explicit DragWindowResizer(WindowResizer* window_resizer,
23 const Details& details);
24 virtual ~DragWindowResizer();
25
26 // WindowResizer overides:
27 virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE;
28 virtual void CompleteDrag(int event_flags) OVERRIDE;
29 virtual void RevertDrag() OVERRIDE;
30 virtual aura::Window* GetTarget() OVERRIDE;
31
32 const gfx::Point& GetInitialLocationInParentForTest() const {
33 return details_.initial_location_in_parent;
34 }
35
36 private:
37 FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController);
38
39 // Updates the bounds of the phantom window for window dragging. Set true on
40 // |in_original_root| if the pointer is still in |window()->GetRootWindow()|.
41 void UpdateDragWindow(const gfx::Rect& bounds, bool in_original_root);
42
43 // Returns true if we should allow the mouse pointer to warp.
44 bool ShouldAllowMouseWarp();
45
46 scoped_ptr<WindowResizer> window_resizer_;
47
48 // Shows a semi-transparent image of the window being dragged.
49 scoped_ptr<DragWindowController> drag_window_controller_;
50
51 const Details details_;
52
53 gfx::Point last_mouse_location_;
54
55 // If non-NULL the destructor sets this to true. Used to determine if this has
56 // been deleted.
57 bool* destroyed_;
58
59 DISALLOW_COPY_AND_ASSIGN(DragWindowResizer);
60 };
61
62 } // namespace internal
63 } // namespace aura
64
65 #endif // ASH_WM_DRAG_WINDOW_RESIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698