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

Unified Diff: components/mus/ws/window_finder.cc

Issue 2119963002: Move mus to //services/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/ws/window_finder.h ('k') | components/mus/ws/window_finder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_finder.cc
diff --git a/components/mus/ws/window_finder.cc b/components/mus/ws/window_finder.cc
deleted file mode 100644
index 466bd5a6a8ea1256bd9871b4568cd6483a93756e..0000000000000000000000000000000000000000
--- a/components/mus/ws/window_finder.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/mus/ws/window_finder.h"
-
-#include "components/mus/surfaces/surfaces_state.h"
-#include "components/mus/ws/server_window.h"
-#include "components/mus/ws/server_window_delegate.h"
-#include "components/mus/ws/server_window_surface.h"
-#include "components/mus/ws/server_window_surface_manager.h"
-#include "components/mus/ws/window_coordinate_conversions.h"
-#include "ui/gfx/geometry/point.h"
-#include "ui/gfx/geometry/point_f.h"
-#include "ui/gfx/transform.h"
-
-namespace mus {
-namespace ws {
-
-bool IsValidWindowForEvents(ServerWindow* window) {
- ServerWindowSurfaceManager* surface_manager = window->surface_manager();
- return surface_manager &&
- surface_manager->HasSurfaceOfType(mojom::SurfaceType::DEFAULT);
-}
-
-ServerWindow* FindDeepestVisibleWindowForEvents(ServerWindow* window,
- gfx::Point* location) {
- const ServerWindow::Windows children(window->GetChildren());
- for (auto iter = children.rbegin(); iter != children.rend(); ++iter) {
- ServerWindow* child = *iter;
- if (!child->visible())
- continue;
-
- // TODO(sky): support transform.
- gfx::Point child_location(location->x() - child->bounds().x(),
- location->y() - child->bounds().y());
- gfx::Rect child_bounds(child->bounds().size());
- child_bounds.Inset(-child->extended_hit_test_region().left(),
- -child->extended_hit_test_region().top(),
- -child->extended_hit_test_region().right(),
- -child->extended_hit_test_region().bottom());
- if (!child_bounds.Contains(child_location))
- continue;
-
- if (child->hit_test_mask() &&
- !child->hit_test_mask()->Contains(child_location))
- continue;
-
- *location = child_location;
- ServerWindow* result = FindDeepestVisibleWindowForEvents(child, location);
- if (IsValidWindowForEvents(result))
- return result;
- }
- return window;
-}
-
-gfx::Transform GetTransformToWindow(ServerWindow* window) {
- gfx::Transform transform;
- ServerWindow* current = window;
- while (current->parent()) {
- transform.Translate(-current->bounds().x(), -current->bounds().y());
- current = current->parent();
- }
- return transform;
-}
-
-} // namespace ws
-} // namespace mus
« no previous file with comments | « components/mus/ws/window_finder.h ('k') | components/mus/ws/window_finder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698