| 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_CONTROLLER_H_ | 5 #ifndef ASH_WM_DRAG_WINDOW_CONTROLLER_H_ |
| 6 #define ASH_WM_DRAG_WINDOW_CONTROLLER_H_ | 6 #define ASH_WM_DRAG_WINDOW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 explicit DragWindowController(aura::Window* window); | 35 explicit DragWindowController(aura::Window* window); |
| 36 virtual ~DragWindowController(); | 36 virtual ~DragWindowController(); |
| 37 | 37 |
| 38 // This is used to update the bounds and opacity for the drag window | 38 // This is used to update the bounds and opacity for the drag window |
| 39 // immediately. | 39 // immediately. |
| 40 // This also creates/destorys the drag window when necessary. | 40 // This also creates/destorys the drag window when necessary. |
| 41 void Update(const gfx::Rect& bounds_in_screen, | 41 void Update(const gfx::Rect& bounds_in_screen, |
| 42 const gfx::Point& drag_location_in_screen); | 42 const gfx::Point& drag_location_in_screen); |
| 43 | 43 |
| 44 private: |
| 45 class DragWindowDetails; |
| 46 FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, DragWindowController); |
| 47 FRIEND_TEST_ALL_PREFIXES(DragWindowResizerTest, |
| 48 DragWindowControllerAcrossThreeDisplays); |
| 49 |
| 44 // Returns the currently active drag windows. | 50 // Returns the currently active drag windows. |
| 45 int GetDragWindowsCountForTest() const; | 51 int GetDragWindowsCountForTest() const; |
| 46 | 52 |
| 47 // Returns the drag window/layer owner for given index of the | 53 // Returns the drag window/layer owner for given index of the |
| 48 // currently active drag windows list. | 54 // currently active drag windows list. |
| 49 const aura::Window* GetDragWindowForTest(size_t index) const; | 55 const aura::Window* GetDragWindowForTest(size_t index) const; |
| 50 const ui::LayerTreeOwner* GetDragLayerOwnerForTest(size_t index) const; | 56 const ui::LayerTreeOwner* GetDragLayerOwnerForTest(size_t index) const; |
| 51 | 57 |
| 52 private: | 58 // Call Layer::OnPaintLayer on all layers under the drag_windows_. |
| 53 class DragWindowDetails; | 59 void RequestLayerPaintForTest(); |
| 54 | 60 |
| 55 // Window the drag window is placed beneath. | 61 // Window the drag window is placed beneath. |
| 56 aura::Window* window_; | 62 aura::Window* window_; |
| 57 | 63 |
| 58 std::vector<std::unique_ptr<DragWindowDetails>> drag_windows_; | 64 std::vector<std::unique_ptr<DragWindowDetails>> drag_windows_; |
| 59 | 65 |
| 60 DISALLOW_COPY_AND_ASSIGN(DragWindowController); | 66 DISALLOW_COPY_AND_ASSIGN(DragWindowController); |
| 61 }; | 67 }; |
| 62 | 68 |
| 63 } // namespace ash | 69 } // namespace ash |
| 64 | 70 |
| 65 #endif // ASH_WM_DRAG_WINDOW_CONTROLLER_H_ | 71 #endif // ASH_WM_DRAG_WINDOW_CONTROLLER_H_ |
| OLD | NEW |