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

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

Issue 13896026: Stick windows to sides of workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dock with zero width (drag resizer instance) Created 7 years, 6 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 unified diff | Download patch
« no previous file with comments | « ash/wm/dock/docked_window_resizer_unittest.cc ('k') | ash/wm/drag_window_resizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_WM_DRAG_WINDOW_RESIZER_H_ 5 #ifndef ASH_WM_DRAG_WINDOW_RESIZER_H_
6 #define ASH_WM_DRAG_WINDOW_RESIZER_H_ 6 #define ASH_WM_DRAG_WINDOW_RESIZER_H_
7 7
8 #include "ash/wm/window_resizer.h" 8 #include "ash/wm/window_resizer.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 11 matching lines...) Expand all
22 virtual ~DragWindowResizer(); 22 virtual ~DragWindowResizer();
23 23
24 // Creates a new DragWindowResizer. The caller takes ownership of the 24 // Creates a new DragWindowResizer. The caller takes ownership of the
25 // returned object. The ownership of |next_window_resizer| is taken by the 25 // returned object. The ownership of |next_window_resizer| is taken by the
26 // returned object. Returns NULL if not resizable. 26 // returned object. Returns NULL if not resizable.
27 static DragWindowResizer* Create(WindowResizer* next_window_resizer, 27 static DragWindowResizer* Create(WindowResizer* next_window_resizer,
28 aura::Window* window, 28 aura::Window* window,
29 const gfx::Point& location, 29 const gfx::Point& location,
30 int window_component); 30 int window_component);
31 31
32 // WindowResizer overides: 32 // WindowResizer:
33 virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE; 33 virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE;
34 virtual void CompleteDrag(int event_flags) OVERRIDE; 34 virtual void CompleteDrag(int event_flags) OVERRIDE;
35 virtual void RevertDrag() OVERRIDE; 35 virtual void RevertDrag() OVERRIDE;
36 virtual aura::Window* GetTarget() OVERRIDE; 36 virtual aura::Window* GetTarget() OVERRIDE;
37 37 virtual const gfx::Point& GetInitialLocation() const OVERRIDE;
38 const gfx::Point& GetInitialLocationInParentForTest() const {
39 return details_.initial_location_in_parent;
40 }
41 38
42 private: 39 private:
43 FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController); 40 FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController);
44 41
45 // Creates DragWindowResizer that adds the ability of dragging windows across 42 // Creates DragWindowResizer that adds the ability of dragging windows across
46 // displays to |next_window_resizer|. This object takes the ownership of 43 // displays to |next_window_resizer|. This object takes the ownership of
47 // |next_window_resizer|. 44 // |next_window_resizer|.
48 explicit DragWindowResizer(WindowResizer* next_window_resizer, 45 explicit DragWindowResizer(WindowResizer* next_window_resizer,
49 const Details& details); 46 const Details& details);
50 47
(...skipping 10 matching lines...) Expand all
61 scoped_ptr<DragWindowController> drag_window_controller_; 58 scoped_ptr<DragWindowController> drag_window_controller_;
62 59
63 const Details details_; 60 const Details details_;
64 61
65 gfx::Point last_mouse_location_; 62 gfx::Point last_mouse_location_;
66 63
67 // If non-NULL the destructor sets this to true. Used to determine if this has 64 // If non-NULL the destructor sets this to true. Used to determine if this has
68 // been deleted. 65 // been deleted.
69 bool* destroyed_; 66 bool* destroyed_;
70 67
68 // Last instance created - for use by the DragWindowResizerTest.
sky 2013/06/17 20:37:23 Last instance created -> Current instance
varkha 2013/06/18 03:22:27 While it is not possible with user interaction I t
flackr 2013/06/18 13:35:03 It is actually possible by dragging one window wit
69 static DragWindowResizer* instance_;
70
71 DISALLOW_COPY_AND_ASSIGN(DragWindowResizer); 71 DISALLOW_COPY_AND_ASSIGN(DragWindowResizer);
72 }; 72 };
73 73
74 } // namespace internal 74 } // namespace internal
75 } // namespace aura 75 } // namespace aura
76 76
77 #endif // ASH_WM_DRAG_WINDOW_RESIZER_H_ 77 #endif // ASH_WM_DRAG_WINDOW_RESIZER_H_
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_resizer_unittest.cc ('k') | ash/wm/drag_window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698