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

Unified Diff: components/mus/ws/window_tree.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
« no previous file with comments | « components/mus/ws/window_tree.h ('k') | ui/views/mus/screen_mus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree.cc
diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
index 863a3a13e61a2095581b0f08fac3b089e39daa76..60c540c83cb0ba776869339deb16b3386ae4a757 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -18,6 +18,7 @@
#include "components/mus/ws/platform_display.h"
#include "components/mus/ws/server_window.h"
#include "components/mus/ws/server_window_observer.h"
+#include "components/mus/ws/user_display_manager.h"
#include "components/mus/ws/window_manager_state.h"
#include "components/mus/ws/window_server.h"
#include "components/mus/ws/window_tree_binding.h"
@@ -669,6 +670,19 @@ WindowManagerState* WindowTree::GetWindowManagerStateForWindowManager() {
return wms;
}
+void WindowTree::GetCursorScreenPoint(
+ const GetCursorScreenPointCallback& callback) {
+ if (roots_.empty()) {
Elliot Glaysher 2016/04/18 20:21:37 Is this empty roots thing a case we reasonably hav
sky 2016/04/18 20:53:05 Yes. It should be possible to query for the cursor
+ mojo::PointPtr p = mojo::Point::New();
+ p->x = 0;
+ p->y = 0;
+ callback.Run(std::move(p));
+ } else {
+ callback.Run(mojo::Point::From(
+ GetWindowManagerState(*roots_.begin())->GetCursorLocation()));
+ }
+}
+
bool WindowTree::ShouldRouteToWindowManager(const ServerWindow* window) const {
// If the client created this window, then do not route it through the WM.
if (window->id().connection_id == id_)
« no previous file with comments | « components/mus/ws/window_tree.h ('k') | ui/views/mus/screen_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698