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

Side by Side Diff: ui/views/mus/mus_client.cc

Issue 2626453002: Standardize Screen::GetCursorScreenPoint() on Env::last_mouse_location (Closed)
Patch Set: explicit Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « ui/views/mus/mus_client.h ('k') | ui/views/mus/screen_mus.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/discardable_memory/client/client_discardable_shared_memory_ manager.h" 10 #include "components/discardable_memory/client/client_discardable_shared_memory_ manager.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } 255 }
256 256
257 aura::client::CaptureClient* MusClient::GetCaptureClient() { 257 aura::client::CaptureClient* MusClient::GetCaptureClient() {
258 return wm::CaptureController::Get(); 258 return wm::CaptureController::Get();
259 } 259 }
260 260
261 aura::PropertyConverter* MusClient::GetPropertyConverter() { 261 aura::PropertyConverter* MusClient::GetPropertyConverter() {
262 return property_converter_.get(); 262 return property_converter_.get();
263 } 263 }
264 264
265 gfx::Point MusClient::GetCursorScreenPoint() {
266 return window_tree_client_->GetCursorScreenPoint();
Elliot Glaysher 2017/01/09 18:16:42 Remove the window tree client code too? (Or are y
sky 2017/01/09 18:20:23 We still need both. As clients don't see all event
267 }
268
269 aura::Window* MusClient::GetWindowAtScreenPoint(const gfx::Point& point) { 265 aura::Window* MusClient::GetWindowAtScreenPoint(const gfx::Point& point) {
270 for (aura::Window* root : window_tree_client_->GetRoots()) { 266 for (aura::Window* root : window_tree_client_->GetRoots()) {
271 aura::WindowTreeHost* window_tree_host = root->GetHost(); 267 aura::WindowTreeHost* window_tree_host = root->GetHost();
272 if (!window_tree_host) 268 if (!window_tree_host)
273 continue; 269 continue;
274 // TODO: this likely gets z-order wrong. http://crbug.com/663606. 270 // TODO: this likely gets z-order wrong. http://crbug.com/663606.
275 gfx::Point relative_point(point); 271 gfx::Point relative_point(point);
276 window_tree_host->ConvertScreenInPixelsToDIP(&relative_point); 272 window_tree_host->ConvertScreenInPixelsToDIP(&relative_point);
277 if (gfx::Rect(root->bounds().size()).Contains(relative_point)) 273 if (gfx::Rect(root->bounds().size()).Contains(relative_point))
278 return root->GetTopWindowContainingPoint(relative_point); 274 return root->GetTopWindowContainingPoint(relative_point);
279 } 275 }
280 return nullptr; 276 return nullptr;
281 } 277 }
282 278
283 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() { 279 std::unique_ptr<OSExchangeData::Provider> MusClient::BuildProvider() {
284 return base::MakeUnique<aura::OSExchangeDataProviderMus>(); 280 return base::MakeUnique<aura::OSExchangeDataProviderMus>();
285 } 281 }
286 282
287 } // namespace views 283 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/mus_client.h ('k') | ui/views/mus/screen_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698