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