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_ID_TRACKER_OBSERVER_H_ | 5 #ifndef SERVICES_UI_WS_FRAME_GENERATOR_DELEGATE_H_ |
6 #define SERVICES_UI_WS_USER_ID_TRACKER_OBSERVER_H_ | 6 #define SERVICES_UI_WS_FRAME_GENERATOR_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include "base/macros.h" |
9 | |
10 #include "services/ui/ws/user_id.h" | |
11 | 9 |
12 namespace ui { | 10 namespace ui { |
13 namespace ws { | 11 namespace ws { |
14 | 12 |
15 class UserIdTrackerObserver { | 13 class ServerWindow; |
| 14 |
| 15 struct ViewportMetrics { |
| 16 gfx::Size size_in_pixels; |
| 17 float device_scale_factor = 0.f; |
| 18 }; |
| 19 |
| 20 class FrameGeneratorDelegate { |
16 public: | 21 public: |
17 virtual void OnActiveUserIdChanged(const UserId& previously_active_id, | 22 // Returns the root window of the display. |
18 const UserId& active_id) {} | 23 virtual ServerWindow* GetRootWindow() = 0; |
19 virtual void OnUserIdAdded(const UserId& id) {} | 24 |
20 virtual void OnUserIdRemoved(const UserId& id) {} | 25 // Called when a compositor frame is finished drawing. |
| 26 virtual void OnCompositorFrameDrawn() = 0; |
| 27 |
| 28 virtual const ViewportMetrics& GetViewportMetrics() = 0; |
21 | 29 |
22 protected: | 30 protected: |
23 virtual ~UserIdTrackerObserver() {} | 31 virtual ~FrameGeneratorDelegate() {} |
24 }; | 32 }; |
25 | 33 |
26 } // namespace ws | 34 } // namespace ws |
27 } // namespace ui | 35 } // namespace ui |
28 | 36 |
29 #endif // SERVICES_UI_WS_USER_ID_TRACKER_OBSERVER_H_ | 37 #endif // SERVICES_UI_WS_FRAME_GENERATOR_DELEGATE_H_ |
OLD | NEW |