| 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 "services/service_manager/public/cpp/connection.h" | 9 #include "services/service_manager/public/cpp/connection.h" |
| 10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 return window_tree_client_->GetCursorScreenPoint(); | 195 return window_tree_client_->GetCursorScreenPoint(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 aura::Window* MusClient::GetWindowAtScreenPoint(const gfx::Point& point) { | 198 aura::Window* MusClient::GetWindowAtScreenPoint(const gfx::Point& point) { |
| 199 for (aura::Window* root : window_tree_client_->GetRoots()) { | 199 for (aura::Window* root : window_tree_client_->GetRoots()) { |
| 200 aura::WindowTreeHost* window_tree_host = root->GetHost(); | 200 aura::WindowTreeHost* window_tree_host = root->GetHost(); |
| 201 if (!window_tree_host) | 201 if (!window_tree_host) |
| 202 continue; | 202 continue; |
| 203 // TODO: this likely gets z-order wrong. http://crbug.com/663606. | 203 // TODO: this likely gets z-order wrong. http://crbug.com/663606. |
| 204 gfx::Point relative_point(point); | 204 gfx::Point relative_point(point); |
| 205 window_tree_host->ConvertPointFromNativeScreen(&relative_point); | 205 window_tree_host->ConvertPointFromNativeScreenToDIP(&relative_point); |
| 206 if (gfx::Rect(root->bounds().size()).Contains(relative_point)) | 206 if (gfx::Rect(root->bounds().size()).Contains(relative_point)) |
| 207 return root->GetTopWindowContainingPoint(relative_point); | 207 return root->GetTopWindowContainingPoint(relative_point); |
| 208 } | 208 } |
| 209 return nullptr; | 209 return nullptr; |
| 210 } | 210 } |
| 211 | 211 |
| 212 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { | 212 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { |
| 213 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); | 213 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 } // namespace views | 216 } // namespace views |
| OLD | NEW |