| OLD | NEW |
| 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 SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_ | 5 #ifndef SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_ |
| 6 #define SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_ | 6 #define SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/atomicops.h" | 10 #include "base/atomicops.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "mojo/public/cpp/bindings/binding_set.h" | 12 #include "mojo/public/cpp/bindings/binding_set.h" |
| 13 #include "mojo/public/cpp/bindings/interface_ptr_set.h" | 13 #include "mojo/public/cpp/bindings/interface_ptr_set.h" |
| 14 #include "services/ui/public/interfaces/display.mojom.h" | 14 #include "services/ui/public/interfaces/display.mojom.h" |
| 15 #include "services/ui/ws/user_id.h" | 15 #include "services/ui/ws/user_id.h" |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class Point; | 18 class Point; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace ui { | 21 namespace ui { |
| 22 namespace ws { | 22 namespace ws { |
| 23 | 23 |
| 24 class Display; | 24 class Display; |
| 25 class DisplayManager; | 25 class DisplayManager; |
| 26 class DisplayManagerDelegate; | 26 class UserDisplayManagerDelegate; |
| 27 | 27 |
| 28 namespace test { | 28 namespace test { |
| 29 class UserDisplayManagerTestApi; | 29 class UserDisplayManagerTestApi; |
| 30 } | 30 } |
| 31 | 31 |
| 32 // Provides per user display state. | 32 // Provides per user display state. |
| 33 class UserDisplayManager : public mojom::DisplayManager { | 33 class UserDisplayManager : public mojom::DisplayManager { |
| 34 public: | 34 public: |
| 35 UserDisplayManager(ws::DisplayManager* display_manager, | 35 UserDisplayManager(ws::DisplayManager* display_manager, |
| 36 DisplayManagerDelegate* delegate, | 36 UserDisplayManagerDelegate* delegate, |
| 37 const UserId& user_id); | 37 const UserId& user_id); |
| 38 ~UserDisplayManager() override; | 38 ~UserDisplayManager() override; |
| 39 | 39 |
| 40 // Called when the frame decorations for this user change. | 40 // Called when the frame decorations for this user change. |
| 41 void OnFrameDecorationValuesChanged(); | 41 void OnFrameDecorationValuesChanged(); |
| 42 | 42 |
| 43 void AddDisplayManagerBinding( | 43 void AddDisplayManagerBinding( |
| 44 mojo::InterfaceRequest<mojom::DisplayManager> request); | 44 mojo::InterfaceRequest<mojom::DisplayManager> request); |
| 45 | 45 |
| 46 // Called by Display prior to |display| being removed and destroyed. | 46 // Called by Display prior to |display| being removed and destroyed. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 72 // Overriden from mojom::DisplayManager: | 72 // Overriden from mojom::DisplayManager: |
| 73 void AddObserver(mojom::DisplayManagerObserverPtr observer) override; | 73 void AddObserver(mojom::DisplayManagerObserverPtr observer) override; |
| 74 | 74 |
| 75 base::subtle::Atomic32* cursor_location_memory() { | 75 base::subtle::Atomic32* cursor_location_memory() { |
| 76 return reinterpret_cast<base::subtle::Atomic32*>( | 76 return reinterpret_cast<base::subtle::Atomic32*>( |
| 77 cursor_location_mapping_.get()); | 77 cursor_location_mapping_.get()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 ws::DisplayManager* display_manager_; | 80 ws::DisplayManager* display_manager_; |
| 81 | 81 |
| 82 DisplayManagerDelegate* delegate_; | 82 UserDisplayManagerDelegate* delegate_; |
| 83 | 83 |
| 84 const UserId user_id_; | 84 const UserId user_id_; |
| 85 | 85 |
| 86 // Set to true the first time at least one Display has valid frame values. | 86 // Set to true the first time at least one Display has valid frame values. |
| 87 bool got_valid_frame_decorations_; | 87 bool got_valid_frame_decorations_; |
| 88 | 88 |
| 89 mojo::BindingSet<mojom::DisplayManager> display_manager_bindings_; | 89 mojo::BindingSet<mojom::DisplayManager> display_manager_bindings_; |
| 90 | 90 |
| 91 // WARNING: only use these once |got_valid_frame_decorations_| is true. | 91 // WARNING: only use these once |got_valid_frame_decorations_| is true. |
| 92 mojo::InterfacePtrSet<mojom::DisplayManagerObserver> | 92 mojo::InterfacePtrSet<mojom::DisplayManagerObserver> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 109 // mojo connection, this data must be read atomically.) | 109 // mojo connection, this data must be read atomically.) |
| 110 mojo::ScopedSharedBufferMapping cursor_location_mapping_; | 110 mojo::ScopedSharedBufferMapping cursor_location_mapping_; |
| 111 | 111 |
| 112 DISALLOW_COPY_AND_ASSIGN(UserDisplayManager); | 112 DISALLOW_COPY_AND_ASSIGN(UserDisplayManager); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 } // namespace ws | 115 } // namespace ws |
| 116 } // namespace ui | 116 } // namespace ui |
| 117 | 117 |
| 118 #endif // SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_ | 118 #endif // SERVICES_UI_WS_USER_DISPLAY_MANAGER_H_ |
| OLD | NEW |