| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/mus/screen_mus.h" | 5 #include "ash/mus/screen_mus.h" |
| 6 | 6 |
| 7 #include "ash/wm/root_window_finder.h" | 7 #include "ash/wm/root_window_finder.h" |
| 8 #include "ash/wm_window.h" | |
| 9 #include "services/ui/public/interfaces/display/display_controller.mojom.h" | 8 #include "services/ui/public/interfaces/display/display_controller.mojom.h" |
| 10 #include "ui/aura/client/screen_position_client.h" | 9 #include "ui/aura/client/screen_position_client.h" |
| 11 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
| 12 #include "ui/aura/mus/window_tree_host_mus.h" | 11 #include "ui/aura/mus/window_tree_host_mus.h" |
| 13 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 14 | 13 |
| 15 namespace ash { | 14 namespace ash { |
| 16 | 15 |
| 17 ScreenMus::ScreenMus(display::mojom::DisplayController* display_controller) | 16 ScreenMus::ScreenMus(display::mojom::DisplayController* display_controller) |
| 18 : display_controller_(display_controller) {} | 17 : display_controller_(display_controller) {} |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 49 |
| 51 gfx::Point ScreenMus::GetCursorScreenPoint() { | 50 gfx::Point ScreenMus::GetCursorScreenPoint() { |
| 52 return aura::Env::GetInstance()->last_mouse_location(); | 51 return aura::Env::GetInstance()->last_mouse_location(); |
| 53 } | 52 } |
| 54 | 53 |
| 55 bool ScreenMus::IsWindowUnderCursor(gfx::NativeWindow window) { | 54 bool ScreenMus::IsWindowUnderCursor(gfx::NativeWindow window) { |
| 56 return GetWindowAtScreenPoint(GetCursorScreenPoint()) == window; | 55 return GetWindowAtScreenPoint(GetCursorScreenPoint()) == window; |
| 57 } | 56 } |
| 58 | 57 |
| 59 gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) { | 58 gfx::NativeWindow ScreenMus::GetWindowAtScreenPoint(const gfx::Point& point) { |
| 60 aura::Window* root_window = | 59 aura::Window* root_window = wm::GetRootWindowAt(point); |
| 61 WmWindow::GetAuraWindow(wm::GetRootWindowAt(point)); | |
| 62 aura::client::ScreenPositionClient* position_client = | 60 aura::client::ScreenPositionClient* position_client = |
| 63 aura::client::GetScreenPositionClient(root_window); | 61 aura::client::GetScreenPositionClient(root_window); |
| 64 | 62 |
| 65 gfx::Point local_point = point; | 63 gfx::Point local_point = point; |
| 66 if (position_client) | 64 if (position_client) |
| 67 position_client->ConvertPointFromScreen(root_window, &local_point); | 65 position_client->ConvertPointFromScreen(root_window, &local_point); |
| 68 | 66 |
| 69 return root_window->GetEventHandlerForPoint(local_point); | 67 return root_window->GetEventHandlerForPoint(local_point); |
| 70 } | 68 } |
| 71 | 69 |
| 72 } // namespace ash | 70 } // namespace ash |
| OLD | NEW |