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

Side by Side Diff: components/mus/ws/user_display_manager.h

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 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 #ifndef COMPONENTS_MUS_WS_USER_DISPLAY_MANAGER_H_ 5 #ifndef COMPONENTS_MUS_WS_USER_DISPLAY_MANAGER_H_
6 #define COMPONENTS_MUS_WS_USER_DISPLAY_MANAGER_H_ 6 #define COMPONENTS_MUS_WS_USER_DISPLAY_MANAGER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "components/mus/public/interfaces/display.mojom.h" 11 #include "components/mus/public/interfaces/display.mojom.h"
12 #include "components/mus/ws/user_id.h" 12 #include "components/mus/ws/user_id.h"
13 #include "mojo/public/cpp/bindings/binding_set.h" 13 #include "mojo/public/cpp/bindings/binding_set.h"
14 #include "mojo/public/cpp/bindings/interface_ptr_set.h" 14 #include "mojo/public/cpp/bindings/interface_ptr_set.h"
15 #include "ui/gfx/geometry/point.h"
15 16
16 namespace mus { 17 namespace mus {
17 namespace ws { 18 namespace ws {
18 19
19 class Display; 20 class Display;
20 class DisplayManager; 21 class DisplayManager;
21 class WindowManagerState; 22 class WindowManagerState;
22 23
23 namespace test { 24 namespace test {
24 class UserDisplayManagerTestApi; 25 class UserDisplayManagerTestApi;
25 } 26 }
26 27
27 // Provides per user display state. 28 // Provides per user display state.
28 class UserDisplayManager : public mojom::DisplayManager { 29 class UserDisplayManager : public mojom::DisplayManager {
29 public: 30 public:
30 UserDisplayManager(ws::DisplayManager* display_manager, 31 UserDisplayManager(ws::DisplayManager* display_manager,
31 const UserId& user_id); 32 const UserId& user_id);
32 ~UserDisplayManager() override; 33 ~UserDisplayManager() override;
33 34
35 gfx::Point cursor_location() { return cursor_location_; }
36
34 void OnFrameDecorationValuesChanged(WindowManagerState* wms); 37 void OnFrameDecorationValuesChanged(WindowManagerState* wms);
35 38
36 void AddDisplayManagerBinding( 39 void AddDisplayManagerBinding(
37 mojo::InterfaceRequest<mojom::DisplayManager> request); 40 mojo::InterfaceRequest<mojom::DisplayManager> request);
38 41
39 // Called by Display prior to |display| being removed and destroyed. 42 // Called by Display prior to |display| being removed and destroyed.
40 void OnWillDestroyDisplay(Display* display); 43 void OnWillDestroyDisplay(Display* display);
41 44
45 // Updates the location of the cursor on this user's display.
46 void OnMouseCursorLocationChanged(const gfx::Point& location);
47
42 private: 48 private:
43 friend class test::UserDisplayManagerTestApi; 49 friend class test::UserDisplayManagerTestApi;
44 50
45 // Returns the WindowManagerStates for the associated user that have frame 51 // Returns the WindowManagerStates for the associated user that have frame
46 // decoration values. 52 // decoration values.
47 std::set<const WindowManagerState*> GetWindowManagerStatesForUser() const; 53 std::set<const WindowManagerState*> GetWindowManagerStatesForUser() const;
48 54
49 void OnObserverAdded(mojom::DisplayManagerObserver* observer); 55 void OnObserverAdded(mojom::DisplayManagerObserver* observer);
50 56
51 // Calls OnDisplays() on |observer|. 57 // Calls OnDisplays() on |observer|.
(...skipping 12 matching lines...) Expand all
64 70
65 // Set to true the first time at least one Display has valid frame values. 71 // Set to true the first time at least one Display has valid frame values.
66 bool got_valid_frame_decorations_ = false; 72 bool got_valid_frame_decorations_ = false;
67 73
68 mojo::BindingSet<mojom::DisplayManager> display_manager_bindings_; 74 mojo::BindingSet<mojom::DisplayManager> display_manager_bindings_;
69 75
70 // WARNING: only use these once |got_valid_frame_decorations_| is true. 76 // WARNING: only use these once |got_valid_frame_decorations_| is true.
71 mojo::InterfacePtrSet<mojom::DisplayManagerObserver> 77 mojo::InterfacePtrSet<mojom::DisplayManagerObserver>
72 display_manager_observers_; 78 display_manager_observers_;
73 79
80 gfx::Point cursor_location_;
81
74 // Observer used for tests. 82 // Observer used for tests.
75 mojom::DisplayManagerObserver* test_observer_ = nullptr; 83 mojom::DisplayManagerObserver* test_observer_ = nullptr;
76 84
77 DISALLOW_COPY_AND_ASSIGN(UserDisplayManager); 85 DISALLOW_COPY_AND_ASSIGN(UserDisplayManager);
78 }; 86 };
79 87
80 } // namespace ws 88 } // namespace ws
81 } // namespace mus 89 } // namespace mus
82 90
83 #endif // COMPONENTS_MUS_WS_USER_DISPLAY_MANAGER_H_ 91 #endif // COMPONENTS_MUS_WS_USER_DISPLAY_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698