| OLD | NEW |
| 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 12 matching lines...) Expand all Loading... |
| 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 aura::client::WindowMoveSource source); | 31 aura::client::WindowMoveSource source); |
| 32 | 32 |
| 33 // WindowResizer overides: | 33 // WindowResizer: |
| 34 virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE; | 34 virtual void Drag(const gfx::Point& location, int event_flags) OVERRIDE; |
| 35 virtual void CompleteDrag(int event_flags) OVERRIDE; | 35 virtual void CompleteDrag(int event_flags) OVERRIDE; |
| 36 virtual void RevertDrag() OVERRIDE; | 36 virtual void RevertDrag() OVERRIDE; |
| 37 virtual aura::Window* GetTarget() OVERRIDE; | 37 virtual aura::Window* GetTarget() OVERRIDE; |
| 38 | 38 virtual const gfx::Point& GetInitialLocation() const OVERRIDE; |
| 39 const gfx::Point& GetInitialLocationInParentForTest() const { | |
| 40 return details_.initial_location_in_parent; | |
| 41 } | |
| 42 | 39 |
| 43 private: | 40 private: |
| 44 FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController); | 41 FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController); |
| 45 | 42 |
| 46 // Creates DragWindowResizer that adds the ability of dragging windows across | 43 // Creates DragWindowResizer that adds the ability of dragging windows across |
| 47 // displays to |next_window_resizer|. This object takes the ownership of | 44 // displays to |next_window_resizer|. This object takes the ownership of |
| 48 // |next_window_resizer|. | 45 // |next_window_resizer|. |
| 49 explicit DragWindowResizer(WindowResizer* next_window_resizer, | 46 explicit DragWindowResizer(WindowResizer* next_window_resizer, |
| 50 const Details& details); | 47 const Details& details); |
| 51 | 48 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 62 scoped_ptr<DragWindowController> drag_window_controller_; | 59 scoped_ptr<DragWindowController> drag_window_controller_; |
| 63 | 60 |
| 64 const Details details_; | 61 const Details details_; |
| 65 | 62 |
| 66 gfx::Point last_mouse_location_; | 63 gfx::Point last_mouse_location_; |
| 67 | 64 |
| 68 // If non-NULL the destructor sets this to true. Used to determine if this has | 65 // If non-NULL the destructor sets this to true. Used to determine if this has |
| 69 // been deleted. | 66 // been deleted. |
| 70 bool* destroyed_; | 67 bool* destroyed_; |
| 71 | 68 |
| 69 // Current instance for use by the DragWindowResizerTest. |
| 70 static DragWindowResizer* instance_; |
| 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(DragWindowResizer); | 72 DISALLOW_COPY_AND_ASSIGN(DragWindowResizer); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace internal | 75 } // namespace internal |
| 76 } // namespace aura | 76 } // namespace aura |
| 77 | 77 |
| 78 #endif // ASH_WM_DRAG_WINDOW_RESIZER_H_ | 78 #endif // ASH_WM_DRAG_WINDOW_RESIZER_H_ |
| OLD | NEW |