| Index: ash/wm/common/root_window_finder.cc
|
| diff --git a/ash/wm/coordinate_conversion.cc b/ash/wm/common/root_window_finder.cc
|
| similarity index 50%
|
| rename from ash/wm/coordinate_conversion.cc
|
| rename to ash/wm/common/root_window_finder.cc
|
| index e591f3f1b6e8b664307a6c4d2cfbcfc207c93f33..69b2f99da6afce035395b49ef5f6e963f812a48e 100644
|
| --- a/ash/wm/coordinate_conversion.cc
|
| +++ b/ash/wm/common/root_window_finder.cc
|
| @@ -2,11 +2,11 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ash/wm/coordinate_conversion.h"
|
| +#include "ash/wm/common/root_window_finder.h"
|
|
|
| #include "ash/display/window_tree_host_manager.h"
|
| -#include "ash/shell.h"
|
| -#include "ui/aura/client/screen_position_client.h"
|
| +#include "ash/wm/common/wm_root_window_controller.h"
|
| +#include "ash/wm/common/wm_window.h"
|
| #include "ui/gfx/display.h"
|
| #include "ui/gfx/geometry/point.h"
|
| #include "ui/gfx/geometry/rect.h"
|
| @@ -15,23 +15,21 @@
|
| namespace ash {
|
| namespace wm {
|
|
|
| -aura::Window* GetRootWindowAt(const gfx::Point& point) {
|
| +WmWindow* GetRootWindowAt(const gfx::Point& point) {
|
| const gfx::Display& display =
|
| gfx::Screen::GetScreen()->GetDisplayNearestPoint(point);
|
| DCHECK(display.is_valid());
|
| - // TODO(yusukes): Move coordinate_conversion.cc and .h to ui/aura/ once
|
| - // GetRootWindowForDisplayId() is moved to aura::Env.
|
| - return Shell::GetInstance()
|
| - ->window_tree_host_manager()
|
| - ->GetRootWindowForDisplayId(display.id());
|
| + WmRootWindowController* root_window_controller =
|
| + WmRootWindowController::GetWithDisplayId(display.id());
|
| + return root_window_controller ? root_window_controller->GetWindow() : nullptr;
|
| }
|
|
|
| -aura::Window* GetRootWindowMatching(const gfx::Rect& rect) {
|
| +WmWindow* GetRootWindowMatching(const gfx::Rect& rect) {
|
| const gfx::Display& display =
|
| gfx::Screen::GetScreen()->GetDisplayMatching(rect);
|
| - return Shell::GetInstance()
|
| - ->window_tree_host_manager()
|
| - ->GetRootWindowForDisplayId(display.id());
|
| + WmRootWindowController* root_window_controller =
|
| + WmRootWindowController::GetWithDisplayId(display.id());
|
| + return root_window_controller ? root_window_controller->GetWindow() : nullptr;
|
| }
|
|
|
| } // namespace wm
|
|
|