OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MASH_WM_FRAME_MOVE_LOOP_H_ | 5 #ifndef MASH_WM_FRAME_MOVE_LOOP_H_ |
6 #define MASH_WM_FRAME_MOVE_LOOP_H_ | 6 #define MASH_WM_FRAME_MOVE_LOOP_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "components/mus/public/cpp/window_observer.h" | 13 #include "components/mus/public/cpp/window_observer.h" |
13 #include "components/mus/public/interfaces/input_events.mojom.h" | 14 #include "components/mus/public/interfaces/input_events.mojom.h" |
14 #include "ui/gfx/geometry/point.h" | 15 #include "ui/gfx/geometry/point.h" |
15 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
16 | 17 |
17 namespace ui { | 18 namespace ui { |
18 class PointerEvent; | 19 class PointerEvent; |
19 } | 20 } |
20 | 21 |
21 namespace mash { | 22 namespace mash { |
(...skipping 21 matching lines...) Expand all Loading... |
43 BOTTOM, | 44 BOTTOM, |
44 OTHER, | 45 OTHER, |
45 }; | 46 }; |
46 | 47 |
47 ~MoveLoop() override; | 48 ~MoveLoop() override; |
48 | 49 |
49 // If a move/resize loop should occur for the specified parameters creates | 50 // If a move/resize loop should occur for the specified parameters creates |
50 // and returns a new MoveLoop. All events should be funneled to the MoveLoop | 51 // and returns a new MoveLoop. All events should be funneled to the MoveLoop |
51 // until done (Move()). |ht_location| is one of the constants defined by | 52 // until done (Move()). |ht_location| is one of the constants defined by |
52 // HitTestCompat. | 53 // HitTestCompat. |
53 static scoped_ptr<MoveLoop> Create(mus::Window* target, | 54 static std::unique_ptr<MoveLoop> Create(mus::Window* target, |
54 int ht_location, | 55 int ht_location, |
55 const ui::PointerEvent& event); | 56 const ui::PointerEvent& event); |
56 | 57 |
57 // Processes an event for a move/resize loop. | 58 // Processes an event for a move/resize loop. |
58 MoveResult Move(const ui::PointerEvent& event); | 59 MoveResult Move(const ui::PointerEvent& event); |
59 | 60 |
60 // If possible reverts any changes made during the move loop. | 61 // If possible reverts any changes made during the move loop. |
61 void Revert(); | 62 void Revert(); |
62 | 63 |
63 private: | 64 private: |
64 enum class Type { | 65 enum class Type { |
65 MOVE, | 66 MOVE, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // canceled if the bounds change unexpectedly during the move. | 120 // canceled if the bounds change unexpectedly during the move. |
120 bool changing_bounds_; | 121 bool changing_bounds_; |
121 | 122 |
122 DISALLOW_COPY_AND_ASSIGN(MoveLoop); | 123 DISALLOW_COPY_AND_ASSIGN(MoveLoop); |
123 }; | 124 }; |
124 | 125 |
125 } // namespace wm | 126 } // namespace wm |
126 } // namespace mash | 127 } // namespace mash |
127 | 128 |
128 #endif // MASH_WM_FRAME_MOVE_LOOP_H_ | 129 #endif // MASH_WM_FRAME_MOVE_LOOP_H_ |
OLD | NEW |