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

Side by Side 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: test mocks too 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/mus/ws/window_tree.h" 5 #include "components/mus/ws/window_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "components/mus/ws/default_access_policy.h" 13 #include "components/mus/ws/default_access_policy.h"
14 #include "components/mus/ws/display.h" 14 #include "components/mus/ws/display.h"
15 #include "components/mus/ws/display_manager.h" 15 #include "components/mus/ws/display_manager.h"
16 #include "components/mus/ws/focus_controller.h" 16 #include "components/mus/ws/focus_controller.h"
17 #include "components/mus/ws/operation.h" 17 #include "components/mus/ws/operation.h"
18 #include "components/mus/ws/platform_display.h" 18 #include "components/mus/ws/platform_display.h"
19 #include "components/mus/ws/server_window.h" 19 #include "components/mus/ws/server_window.h"
20 #include "components/mus/ws/server_window_observer.h" 20 #include "components/mus/ws/server_window_observer.h"
21 #include "components/mus/ws/user_display_manager.h"
21 #include "components/mus/ws/window_manager_state.h" 22 #include "components/mus/ws/window_manager_state.h"
22 #include "components/mus/ws/window_server.h" 23 #include "components/mus/ws/window_server.h"
23 #include "components/mus/ws/window_tree_binding.h" 24 #include "components/mus/ws/window_tree_binding.h"
24 #include "mojo/converters/geometry/geometry_type_converters.h" 25 #include "mojo/converters/geometry/geometry_type_converters.h"
25 #include "mojo/converters/ime/ime_type_converters.h" 26 #include "mojo/converters/ime/ime_type_converters.h"
26 #include "mojo/converters/input_events/input_events_type_converters.h" 27 #include "mojo/converters/input_events/input_events_type_converters.h"
27 #include "mojo/converters/surfaces/surfaces_type_converters.h" 28 #include "mojo/converters/surfaces/surfaces_type_converters.h"
28 #include "ui/platform_window/text_input_state.h" 29 #include "ui/platform_window/text_input_state.h"
29 30
30 using mojo::Array; 31 using mojo::Array;
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 DCHECK(window_manager_internal_); 663 DCHECK(window_manager_internal_);
663 664
664 WindowManagerState* wms = display_manager() 665 WindowManagerState* wms = display_manager()
665 ->GetWindowManagerAndDisplay(*roots_.begin()) 666 ->GetWindowManagerAndDisplay(*roots_.begin())
666 .window_manager_state; 667 .window_manager_state;
667 CHECK(wms); 668 CHECK(wms);
668 DCHECK_EQ(this, wms->tree()); 669 DCHECK_EQ(this, wms->tree());
669 return wms; 670 return wms;
670 } 671 }
671 672
673 void WindowTree::GetCursorScreenPoint(
674 const GetCursorScreenPointCallback& callback) {
675 callback.Run(mojo::Point::From(
676 display_manager()->GetUserDisplayManager(user_id_)->cursor_location()));
677 }
678
672 bool WindowTree::ShouldRouteToWindowManager(const ServerWindow* window) const { 679 bool WindowTree::ShouldRouteToWindowManager(const ServerWindow* window) const {
673 // If the client created this window, then do not route it through the WM. 680 // If the client created this window, then do not route it through the WM.
674 if (window->id().connection_id == id_) 681 if (window->id().connection_id == id_)
675 return false; 682 return false;
676 683
677 // If the client did not create the window, then it must be the root of the 684 // If the client did not create the window, then it must be the root of the
678 // client. If not, that means the client should not know about this window, 685 // client. If not, that means the client should not know about this window,
679 // and so do not route the request to the WM. 686 // and so do not route the request to the WM.
680 if (roots_.count(window) == 0) 687 if (roots_.count(window) == 0)
681 return false; 688 return false;
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 } 1415 }
1409 1416
1410 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( 1417 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy(
1411 const ServerWindow* window) const { 1418 const ServerWindow* window) const {
1412 WindowTree* tree = window_server_->GetTreeWithRoot(window); 1419 WindowTree* tree = window_server_->GetTreeWithRoot(window);
1413 return tree && tree != this; 1420 return tree && tree != this;
1414 } 1421 }
1415 1422
1416 } // namespace ws 1423 } // namespace ws
1417 } // namespace mus 1424 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698