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 "components/mus/ws/window_finder.h" | 5 #include "components/mus/ws/window_finder.h" |
6 | 6 |
7 #include "cc/surfaces/surface_id.h" | 7 #include "cc/surfaces/surface_id.h" |
8 #include "components/mus/surfaces/surfaces_state.h" | 8 #include "components/mus/surfaces/surfaces_state.h" |
9 #include "components/mus/ws/server_window.h" | 9 #include "components/mus/ws/server_window.h" |
10 #include "components/mus/ws/server_window_delegate.h" | 10 #include "components/mus/ws/server_window_delegate.h" |
11 #include "components/mus/ws/server_window_surface.h" | 11 #include "components/mus/ws/server_window_surface.h" |
12 #include "components/mus/ws/server_window_surface_manager.h" | 12 #include "components/mus/ws/server_window_surface_manager.h" |
13 #include "components/mus/ws/window_coordinate_conversions.h" | 13 #include "components/mus/ws/window_coordinate_conversions.h" |
14 #include "ui/gfx/geometry/point.h" | 14 #include "ui/gfx/geometry/point.h" |
15 #include "ui/gfx/geometry/point_f.h" | 15 #include "ui/gfx/geometry/point_f.h" |
16 #include "ui/gfx/transform.h" | 16 #include "ui/gfx/transform.h" |
17 | 17 |
18 namespace mus { | 18 namespace mus { |
19 namespace ws { | 19 namespace ws { |
20 namespace { | 20 namespace { |
21 | 21 |
22 bool IsValidWindowForEvents(ServerWindow* window) { | 22 bool IsValidWindowForEvents(ServerWindow* window) { |
23 ServerWindowSurfaceManager* surface_manager = window->surface_manager(); | 23 ServerWindowSurfaceManager* surface_manager = window->surface_manager(); |
24 return surface_manager && | 24 return surface_manager && |
25 surface_manager->HasSurfaceOfType(mojom::SURFACE_TYPE_DEFAULT); | 25 surface_manager->HasSurfaceOfType(mojom::SurfaceType::DEFAULT); |
26 } | 26 } |
27 | 27 |
28 ServerWindow* FindDeepestVisibleWindowNonSurface(ServerWindow* window, | 28 ServerWindow* FindDeepestVisibleWindowNonSurface(ServerWindow* window, |
29 gfx::Point* location) { | 29 gfx::Point* location) { |
30 const ServerWindow::Windows children(window->GetChildren()); | 30 const ServerWindow::Windows children(window->GetChildren()); |
31 for (auto iter = children.rbegin(); iter != children.rend(); ++iter) { | 31 for (auto iter = children.rbegin(); iter != children.rend(); ++iter) { |
32 ServerWindow* child = *iter; | 32 ServerWindow* child = *iter; |
33 if (!child->visible()) | 33 if (!child->visible()) |
34 continue; | 34 continue; |
35 | 35 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 if (target) | 107 if (target) |
108 transform.TransformPoint(location); | 108 transform.TransformPoint(location); |
109 return target; | 109 return target; |
110 } | 110 } |
111 | 111 |
112 gfx::Transform GetTransformToWindow(cc::SurfaceId display_surface_id, | 112 gfx::Transform GetTransformToWindow(cc::SurfaceId display_surface_id, |
113 ServerWindow* window) { | 113 ServerWindow* window) { |
114 if (!display_surface_id.is_null()) { | 114 if (!display_surface_id.is_null()) { |
115 gfx::Transform transform; | 115 gfx::Transform transform; |
116 if (HitTestSurfaceOfType(display_surface_id, window, | 116 if (HitTestSurfaceOfType(display_surface_id, window, |
117 mus::mojom::SURFACE_TYPE_DEFAULT, &transform) || | 117 mus::mojom::SurfaceType::DEFAULT, &transform) || |
118 HitTestSurfaceOfType(display_surface_id, window, | 118 HitTestSurfaceOfType(display_surface_id, window, |
119 mus::mojom::SURFACE_TYPE_UNDERLAY, &transform)) { | 119 mus::mojom::SurfaceType::UNDERLAY, &transform)) { |
120 return transform; | 120 return transform; |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 return GetTransformToWindowNonSurface(window); | 124 return GetTransformToWindowNonSurface(window); |
125 } | 125 } |
126 | 126 |
127 } // namespace ws | 127 } // namespace ws |
128 } // namespace mus | 128 } // namespace mus |
OLD | NEW |