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 #include "mash/wm/move_loop.h" | 5 #include "mash/wm/frame/move_loop.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "components/mus/public/cpp/window.h" | 8 #include "components/mus/public/cpp/window.h" |
9 #include "components/mus/public/interfaces/input_event_constants.mojom.h" | 9 #include "components/mus/public/interfaces/input_event_constants.mojom.h" |
10 #include "mash/wm/property_util.h" | 10 #include "mash/wm/property_util.h" |
11 #include "ui/gfx/geometry/point_conversions.h" | 11 #include "ui/gfx/geometry/point_conversions.h" |
12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
13 | 13 |
| 14 namespace mash { |
| 15 namespace wm { |
| 16 |
14 namespace { | 17 namespace { |
15 | 18 |
16 gfx::Point EventLocationToPoint(const mus::mojom::Event& event) { | 19 gfx::Point EventLocationToPoint(const mus::mojom::Event& event) { |
17 return gfx::ToFlooredPoint(gfx::PointF(event.pointer_data->location->x, | 20 return gfx::ToFlooredPoint(gfx::PointF(event.pointer_data->location->x, |
18 event.pointer_data->location->y)); | 21 event.pointer_data->location->y)); |
19 } | 22 } |
20 | 23 |
21 gfx::Point EventScreenLocationToPoint(const mus::mojom::Event& event) { | 24 gfx::Point EventScreenLocationToPoint(const mus::mojom::Event& event) { |
22 return gfx::ToFlooredPoint( | 25 return gfx::ToFlooredPoint( |
23 gfx::PointF(event.pointer_data->location->screen_x, | 26 gfx::PointF(event.pointer_data->location->screen_x, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 const gfx::Rect& new_bounds) { | 217 const gfx::Rect& new_bounds) { |
215 DCHECK_EQ(window, target_); | 218 DCHECK_EQ(window, target_); |
216 if (!changing_bounds_) | 219 if (!changing_bounds_) |
217 Cancel(); | 220 Cancel(); |
218 } | 221 } |
219 | 222 |
220 void MoveLoop::OnWindowVisibilityChanged(mus::Window* window) { | 223 void MoveLoop::OnWindowVisibilityChanged(mus::Window* window) { |
221 DCHECK_EQ(window, target_); | 224 DCHECK_EQ(window, target_); |
222 Cancel(); | 225 Cancel(); |
223 } | 226 } |
| 227 |
| 228 } // namespace wm |
| 229 } // namespace mash |
OLD | NEW |