| 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 "ui/views/mus/mus_client.h" | 5 #include "ui/views/mus/mus_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "services/service_manager/public/cpp/connection.h" | 10 #include "services/service_manager/public/cpp/connection.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 aura::Window* MusClient::GetWindowAtScreenPoint(const gfx::Point& point) { | 294 aura::Window* MusClient::GetWindowAtScreenPoint(const gfx::Point& point) { |
| 295 for (aura::Window* root : window_tree_client_->GetRoots()) { | 295 for (aura::Window* root : window_tree_client_->GetRoots()) { |
| 296 aura::WindowTreeHost* window_tree_host = root->GetHost(); | 296 aura::WindowTreeHost* window_tree_host = root->GetHost(); |
| 297 if (!window_tree_host) | 297 if (!window_tree_host) |
| 298 continue; | 298 continue; |
| 299 // TODO: this likely gets z-order wrong. http://crbug.com/663606. | 299 // TODO: this likely gets z-order wrong. http://crbug.com/663606. |
| 300 gfx::Point relative_point(point); | 300 gfx::Point relative_point(point); |
| 301 window_tree_host->ConvertScreenInPixelsToDIP(&relative_point); | 301 window_tree_host->ConvertScreenInPixelsToDIP(&relative_point); |
| 302 if (gfx::Rect(root->bounds().size()).Contains(relative_point)) | 302 if (gfx::Rect(root->bounds().size()).Contains(relative_point)) |
| 303 return root->GetTopWindowContainingPoint(relative_point); | 303 return root->GetEventHandlerForPoint(relative_point); |
| 304 } | 304 } |
| 305 return nullptr; | 305 return nullptr; |
| 306 } | 306 } |
| 307 | 307 |
| 308 } // namespace views | 308 } // namespace views |
| OLD | NEW |