Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: services/ui/ws/window_finder.cc

Issue 2429173005: Mus+Ash: Replace (Server)WindowSurface with (Server)WindowCompositorFrameSink (Closed)
Patch Set: Rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/window_finder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "services/ui/ws/window_finder.h" 5 #include "services/ui/ws/window_finder.h"
6 6
7 #include "base/containers/adapters.h" 7 #include "base/containers/adapters.h"
8 #include "services/ui/ws/server_window.h" 8 #include "services/ui/ws/server_window.h"
9 #include "services/ui/ws/server_window_compositor_frame_sink.h"
10 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h"
9 #include "services/ui/ws/server_window_delegate.h" 11 #include "services/ui/ws/server_window_delegate.h"
10 #include "services/ui/ws/server_window_surface.h"
11 #include "services/ui/ws/server_window_surface_manager.h"
12 #include "services/ui/ws/window_coordinate_conversions.h" 12 #include "services/ui/ws/window_coordinate_conversions.h"
13 #include "ui/gfx/geometry/point.h" 13 #include "ui/gfx/geometry/point.h"
14 #include "ui/gfx/geometry/point_f.h" 14 #include "ui/gfx/geometry/point_f.h"
15 #include "ui/gfx/transform.h" 15 #include "ui/gfx/transform.h"
16 16
17 namespace ui { 17 namespace ui {
18 namespace ws { 18 namespace ws {
19 19
20 bool IsValidWindowForEvents(ServerWindow* window) { 20 bool IsValidWindowForEvents(ServerWindow* window) {
21 ServerWindowSurfaceManager* surface_manager = window->surface_manager(); 21 ServerWindowCompositorFrameSinkManager* compositor_frame_sink_manager =
22 window->compositor_frame_sink_manager();
22 // Valid windows have at least one of the two surface types. Only an underlay 23 // Valid windows have at least one of the two surface types. Only an underlay
23 // is valid as we assume the window manager will likely get the event in this 24 // is valid as we assume the window manager will likely get the event in this
24 // case. 25 // case.
25 return surface_manager && 26 return compositor_frame_sink_manager &&
26 (surface_manager->HasSurfaceOfType(mojom::SurfaceType::DEFAULT) || 27 (compositor_frame_sink_manager->HasCompositorFrameSinkOfType(
27 surface_manager->HasSurfaceOfType(mojom::SurfaceType::UNDERLAY)); 28 mojom::CompositorFrameSinkType::DEFAULT) ||
29 compositor_frame_sink_manager->HasCompositorFrameSinkOfType(
30 mojom::CompositorFrameSinkType::UNDERLAY));
28 } 31 }
29 32
30 ServerWindow* FindDeepestVisibleWindowForEvents(ServerWindow* window, 33 ServerWindow* FindDeepestVisibleWindowForEvents(ServerWindow* window,
31 gfx::Point* location) { 34 gfx::Point* location) {
32 if (!window->can_accept_events()) 35 if (!window->can_accept_events())
33 return nullptr; 36 return nullptr;
34 37
35 const ServerWindow::Windows& children = window->children(); 38 const ServerWindow::Windows& children = window->children();
36 for (ServerWindow* child : base::Reversed(children)) { 39 for (ServerWindow* child : base::Reversed(children)) {
37 if (!child->visible() || !child->can_accept_events()) 40 if (!child->visible() || !child->can_accept_events())
(...skipping 27 matching lines...) Expand all
65 ServerWindow* current = window; 68 ServerWindow* current = window;
66 while (current->parent()) { 69 while (current->parent()) {
67 transform.Translate(-current->bounds().x(), -current->bounds().y()); 70 transform.Translate(-current->bounds().x(), -current->bounds().y());
68 current = current->parent(); 71 current = current->parent();
69 } 72 }
70 return transform; 73 return transform;
71 } 74 }
72 75
73 } // namespace ws 76 } // namespace ws
74 } // namespace ui 77 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | services/ui/ws/window_finder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698