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 namespace gfx { | 8 namespace gfx { |
9 class Size; | 9 class Size; |
10 } | 10 } |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 class Event; | 14 class Event; |
15 | 15 |
16 namespace ws { | 16 namespace ws { |
17 | 17 |
18 class ServerWindow; | 18 class ServerWindow; |
19 struct ViewportMetrics; | |
20 | 19 |
21 // PlatformDisplayDelegate is implemented by an object that manages the | 20 // PlatformDisplayDelegate is implemented by an object that manages the |
22 // lifetime of a PlatformDisplay, forwards events to the appropriate windows, | 21 // lifetime of a PlatformDisplay, forwards events to the appropriate windows, |
23 /// and responses to changes in viewport size. | 22 /// and responses to changes in viewport size. |
24 class PlatformDisplayDelegate { | 23 class PlatformDisplayDelegate { |
25 public: | 24 public: |
26 // Creates the root window for this display. The new root window will have | 25 // Creates the root window for this display. The new root window will have |
27 // |size| in DIP initially. | 26 // |size| in DIP initially. |
28 virtual void CreateRootWindow(const gfx::Size& size) = 0; | 27 virtual void CreateRootWindow(const gfx::Size& size) = 0; |
29 | 28 |
30 // Returns the root window of this display. | 29 // Returns the root window of this display. |
31 virtual ServerWindow* GetRootWindow() = 0; | 30 virtual ServerWindow* GetRootWindow() = 0; |
32 | 31 |
33 virtual bool IsInHighContrastMode() = 0; | 32 virtual bool IsInHighContrastMode() = 0; |
34 | 33 |
35 // Called when an event arrives. | 34 // Called when an event arrives. |
36 virtual void OnEvent(const ui::Event& event) = 0; | 35 virtual void OnEvent(const ui::Event& event) = 0; |
37 | 36 |
38 // Called when the Display loses capture. | 37 // Called when the Display loses capture. |
39 virtual void OnNativeCaptureLost() = 0; | 38 virtual void OnNativeCaptureLost() = 0; |
40 | 39 |
41 // Signals that the metrics of this display's viewport has changed. | |
42 virtual void OnViewportMetricsChanged(const ViewportMetrics& old_metrics, | |
43 const ViewportMetrics& new_metrics) = 0; | |
44 | |
45 protected: | 40 protected: |
46 virtual ~PlatformDisplayDelegate() {} | 41 virtual ~PlatformDisplayDelegate() {} |
47 }; | 42 }; |
48 | 43 |
49 } // namespace ws | 44 } // namespace ws |
50 | 45 |
51 } // namespace ui | 46 } // namespace ui |
52 | 47 |
53 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DELEGATE_H_ | 48 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DELEGATE_H_ |
OLD | NEW |