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_DISPLAY_MANAGER_H_ | 5 #ifndef SERVICES_UI_WS_DISPLAY_MANAGER_H_ |
6 #define SERVICES_UI_WS_DISPLAY_MANAGER_H_ | 6 #define SERVICES_UI_WS_DISPLAY_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 bool has_displays() const { return !displays_.empty(); } | 62 bool has_displays() const { return !displays_.empty(); } |
63 bool has_active_or_pending_displays() const { | 63 bool has_active_or_pending_displays() const { |
64 return !displays_.empty() || !pending_displays_.empty(); | 64 return !displays_.empty() || !pending_displays_.empty(); |
65 } | 65 } |
66 | 66 |
67 // Returns the id for the next root window (both for the root of a Display | 67 // Returns the id for the next root window (both for the root of a Display |
68 // as well as the root of WindowManagers). | 68 // as well as the root of WindowManagers). |
69 WindowId GetAndAdvanceNextRootId(); | 69 WindowId GetAndAdvanceNextRootId(); |
70 | 70 |
71 uint32_t GetAndAdvanceNextDisplayId(); | |
72 | |
73 // Called when the AcceleratedWidget is available for |display|. | 71 // Called when the AcceleratedWidget is available for |display|. |
74 void OnDisplayAcceleratedWidgetAvailable(Display* display); | 72 void OnDisplayAcceleratedWidgetAvailable(Display* display); |
75 | 73 |
76 private: | 74 private: |
77 // UserIdTrackerObserver: | 75 // UserIdTrackerObserver: |
78 void OnActiveUserIdChanged(const UserId& previously_active_id, | 76 void OnActiveUserIdChanged(const UserId& previously_active_id, |
79 const UserId& active_id) override; | 77 const UserId& active_id) override; |
80 | 78 |
81 DisplayManagerDelegate* delegate_; | 79 DisplayManagerDelegate* delegate_; |
82 UserIdTracker* user_id_tracker_; | 80 UserIdTracker* user_id_tracker_; |
83 | 81 |
84 // Displays are initially added to |pending_displays_|. When the display is | 82 // Displays are initially added to |pending_displays_|. When the display is |
85 // initialized it is moved to |displays_|. WindowServer owns the Displays. | 83 // initialized it is moved to |displays_|. WindowServer owns the Displays. |
86 std::set<Display*> pending_displays_; | 84 std::set<Display*> pending_displays_; |
87 std::set<Display*> displays_; | 85 std::set<Display*> displays_; |
88 | 86 |
89 std::map<UserId, std::unique_ptr<UserDisplayManager>> user_display_managers_; | 87 std::map<UserId, std::unique_ptr<UserDisplayManager>> user_display_managers_; |
90 | 88 |
91 // ID to use for next root node. | 89 // ID to use for next root node. |
92 ClientSpecificId next_root_id_; | 90 ClientSpecificId next_root_id_; |
93 | 91 |
94 uint32_t next_display_id_; | |
95 | |
96 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 92 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
97 }; | 93 }; |
98 | 94 |
99 } // namespace ws | 95 } // namespace ws |
100 } // namespace ui | 96 } // namespace ui |
101 | 97 |
102 #endif // SERVICES_UI_WS_DISPLAY_MANAGER_H_ | 98 #endif // SERVICES_UI_WS_DISPLAY_MANAGER_H_ |
OLD | NEW |