| 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 display { | 8 namespace display { |
| 9 class Display; | 9 class Display; |
| 10 } | 10 } |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 | 13 |
| 14 class EventSink; | 14 class EventSink; |
| 15 class OzonePlatform; |
| 15 | 16 |
| 16 namespace ws { | 17 namespace ws { |
| 17 | 18 |
| 18 class ServerWindow; | 19 class ServerWindow; |
| 19 | 20 |
| 20 // PlatformDisplayDelegate is implemented by an object that manages the | 21 // PlatformDisplayDelegate is implemented by an object that manages the |
| 21 // lifetime of a PlatformDisplay, forwards events to the appropriate windows, | 22 // lifetime of a PlatformDisplay, forwards events to the appropriate windows, |
| 22 /// and responses to changes in viewport size. | 23 /// and responses to changes in viewport size. |
| 23 class PlatformDisplayDelegate { | 24 class PlatformDisplayDelegate { |
| 24 public: | 25 public: |
| 25 // Returns a display::Display for this display. | 26 // Returns a display::Display for this display. |
| 26 virtual const display::Display& GetDisplay() = 0; | 27 virtual const display::Display& GetDisplay() = 0; |
| 27 | 28 |
| 28 // Returns the root window of this display. | 29 // Returns the root window of this display. |
| 29 virtual ServerWindow* GetRootWindow() = 0; | 30 virtual ServerWindow* GetRootWindow() = 0; |
| 30 | 31 |
| 31 // Returns the event sink of this display; | 32 // Returns the event sink of this display; |
| 32 virtual EventSink* GetEventSink() = 0; | 33 virtual EventSink* GetEventSink() = 0; |
| 33 | 34 |
| 34 // Called once when the AcceleratedWidget is available for drawing. | 35 // Called once when the AcceleratedWidget is available for drawing. |
| 35 virtual void OnAcceleratedWidgetAvailable() = 0; | 36 virtual void OnAcceleratedWidgetAvailable() = 0; |
| 36 | 37 |
| 37 // Called when the Display loses capture. | 38 // Called when the Display loses capture. |
| 38 virtual void OnNativeCaptureLost() = 0; | 39 virtual void OnNativeCaptureLost() = 0; |
| 39 | 40 |
| 41 // Allows the OzonePlatform to be overridden, e.g. for tests. Returns null |
| 42 // for non-Ozone platforms. |
| 43 virtual OzonePlatform* GetOzonePlatform() = 0; |
| 44 |
| 40 protected: | 45 protected: |
| 41 virtual ~PlatformDisplayDelegate() {} | 46 virtual ~PlatformDisplayDelegate() {} |
| 42 }; | 47 }; |
| 43 | 48 |
| 44 } // namespace ws | 49 } // namespace ws |
| 45 | 50 |
| 46 } // namespace ui | 51 } // namespace ui |
| 47 | 52 |
| 48 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DELEGATE_H_ | 53 #endif // SERVICES_UI_WS_PLATFORM_DISPLAY_DELEGATE_H_ |
| OLD | NEW |