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

Unified Diff: components/mus/public/cpp/lib/window_tree_client_impl.cc

Issue 1881253002: mus: Implement ScreenMus::GetCursorScreenPoint(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't crash on empty roots. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/mus/public/cpp/lib/window_tree_client_impl.cc
diff --git a/components/mus/public/cpp/lib/window_tree_client_impl.cc b/components/mus/public/cpp/lib/window_tree_client_impl.cc
index 23cc50de852f8f286bb2f203dd2c3bc5f2442b9f..5cb13c4a3c96f1749a1ff9eb10fb791ffdefd465 100644
--- a/components/mus/public/cpp/lib/window_tree_client_impl.cc
+++ b/components/mus/public/cpp/lib/window_tree_client_impl.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
+#include "base/threading/thread_restrictions.h"
#include "components/mus/common/util.h"
#include "components/mus/public/cpp/input_event_handler.h"
#include "components/mus/public/cpp/lib/in_flight_change.h"
@@ -814,6 +815,15 @@ Window* WindowTreeClientImpl::GetCaptureWindow() {
return capture_window_;
}
+gfx::Point WindowTreeClientImpl::GetCursorScreenPoint() {
+ // TODO(erg): This function should opportunistically use the location of the
+ // current event, if we are currently dispatching one.
+ base::ThreadRestrictions::ScopedAllowWait allow_wait;
+ mojo::PointPtr p;
+ tree_ptr_->GetCursorScreenPoint(&p);
+ return p.To<gfx::Point>();
+}
+
void WindowTreeClientImpl::OnWindowVisibilityChanged(Id window_id,
bool visible) {
Window* window = GetWindowByServerId(window_id);

Powered by Google App Engine
This is Rietveld 408576698