OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_MUS_WS_PLATFORM_DISPLAY_DELEGATE_H_ | |
6 #define COMPONENTS_MUS_WS_PLATFORM_DISPLAY_DELEGATE_H_ | |
7 | |
8 #include "components/mus/ws/ids.h" | |
9 | |
10 namespace ui { | |
11 class Event; | |
12 } | |
13 | |
14 namespace mus { | |
15 | |
16 namespace ws { | |
17 | |
18 class ServerWindow; | |
19 struct ViewportMetrics; | |
20 | |
21 // PlatformDisplayDelegate is implemented by an object that manages the | |
22 // lifetime of a PlatformDisplay, forwards events to the appropriate windows, | |
23 /// and responses to changes in viewport size. | |
24 class PlatformDisplayDelegate { | |
25 public: | |
26 // Returns the root window of this display. | |
27 virtual ServerWindow* GetRootWindow() = 0; | |
28 | |
29 // Called when the window managed by the PlatformDisplay is closed. | |
30 virtual void OnDisplayClosed() = 0; | |
31 | |
32 // Called when an event arrives. | |
33 virtual void OnEvent(const ui::Event& event) = 0; | |
34 | |
35 // Called when the Display loses capture. | |
36 virtual void OnNativeCaptureLost() = 0; | |
37 | |
38 // Signals that the metrics of this display's viewport has changed. | |
39 virtual void OnViewportMetricsChanged(const ViewportMetrics& old_metrics, | |
40 const ViewportMetrics& new_metrics) = 0; | |
41 | |
42 // Called when a compositor frame is finished drawing. | |
43 virtual void OnCompositorFrameDrawn() = 0; | |
44 | |
45 protected: | |
46 virtual ~PlatformDisplayDelegate() {} | |
47 }; | |
48 | |
49 } // namespace ws | |
50 | |
51 } // namespace mus | |
52 | |
53 #endif // COMPONENTS_MUS_WS_PLATFORM_DISPLAY_DELEGATE_H_ | |
OLD | NEW |