OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_PLATFORM_DISPLAY_DELEGATE_H_ | 5 #ifndef SERVICES_UI_WS_PLATFORM_DISPLAY_DELEGATE_H_ |
6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_DELEGATE_H_ | 6 #define SERVICES_UI_WS_PLATFORM_DISPLAY_DELEGATE_H_ |
7 | 7 |
8 #include "services/ui/ws/ids.h" | 8 #include "services/ui/ws/ids.h" |
9 | 9 |
10 namespace gfx { | |
11 class Size; | |
12 } | |
13 | |
10 namespace ui { | 14 namespace ui { |
rjkroege
2016/09/23 13:56:23
nit: why two namespace ui?
kylechar
2016/09/23 14:22:28
Probably something like "s/namespace mus/namespace
| |
11 class Event; | 15 class Event; |
12 } | 16 } |
13 | 17 |
14 namespace ui { | 18 namespace ui { |
15 | 19 |
16 namespace ws { | 20 namespace ws { |
17 | 21 |
18 class ServerWindow; | 22 class ServerWindow; |
19 struct ViewportMetrics; | 23 struct ViewportMetrics; |
20 | 24 |
21 // PlatformDisplayDelegate is implemented by an object that manages the | 25 // PlatformDisplayDelegate is implemented by an object that manages the |
22 // lifetime of a PlatformDisplay, forwards events to the appropriate windows, | 26 // lifetime of a PlatformDisplay, forwards events to the appropriate windows, |
23 /// and responses to changes in viewport size. | 27 /// and responses to changes in viewport size. |
24 class PlatformDisplayDelegate { | 28 class PlatformDisplayDelegate { |
25 public: | 29 public: |
30 // Creates the root window for this display. The new root window will have | |
31 // |size| in DIP initially. | |
32 virtual void CreateRootWindow(const gfx::Size& size) = 0; | |
33 | |
26 // Returns the root window of this display. | 34 // Returns the root window of this display. |
27 virtual ServerWindow* GetRootWindow() = 0; | 35 virtual ServerWindow* GetRootWindow() = 0; |
28 | 36 |
29 virtual bool IsInHighContrastMode() = 0; | 37 virtual bool IsInHighContrastMode() = 0; |
30 | 38 |
31 // Called when an event arrives. | 39 // Called when an event arrives. |
32 virtual void OnEvent(const ui::Event& event) = 0; | 40 virtual void OnEvent(const ui::Event& event) = 0; |
33 | 41 |
34 // Called when the Display loses capture. | 42 // Called when the Display loses capture. |
35 virtual void OnNativeCaptureLost() = 0; | 43 virtual void OnNativeCaptureLost() = 0; |
36 | 44 |
37 // Signals that the metrics of this display's viewport has changed. | 45 // Signals that the metrics of this display's viewport has changed. |
38 virtual void OnViewportMetricsChanged(const ViewportMetrics& old_metrics, | 46 virtual void OnViewportMetricsChanged(const ViewportMetrics& old_metrics, |
39 const ViewportMetrics& new_metrics) = 0; | 47 const ViewportMetrics& new_metrics) = 0; |
40 | 48 |
41 // Called when a compositor frame is finished drawing. | 49 // Called when a compositor frame is finished drawing. |
42 virtual void OnCompositorFrameDrawn() = 0; | 50 virtual void OnCompositorFrameDrawn() = 0; |
43 | 51 |
44 protected: | 52 protected: |
45 virtual ~PlatformDisplayDelegate() {} | 53 virtual ~PlatformDisplayDelegate() {} |
46 }; | 54 }; |
47 | 55 |
48 } // namespace ws | 56 } // namespace ws |
49 | 57 |
50 } // namespace ui | 58 } // namespace ui |
51 | 59 |
52 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DELEGATE_H_ | 60 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DELEGATE_H_ |
OLD | NEW |