| 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 COMPONENTS_MUS_WS_DISPLAY_MANAGER_DELEGATE_H_ | 5 #ifndef COMPONENTS_MUS_WS_DISPLAY_MANAGER_DELEGATE_H_ |
| 6 #define COMPONENTS_MUS_WS_DISPLAY_MANAGER_DELEGATE_H_ | 6 #define COMPONENTS_MUS_WS_DISPLAY_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "components/mus/public/interfaces/view_tree.mojom.h" | 8 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 9 #include "components/mus/ws/ids.h" | 9 #include "components/mus/ws/ids.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 struct SurfaceId; | 12 struct SurfaceId; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace mus { | 15 namespace mus { |
| 16 | 16 |
| 17 class ServerView; | 17 class ServerView; |
| 18 | 18 |
| 19 // A DisplayManagerDelegate an interface to be implemented by an object that | 19 // A DisplayManagerDelegate an interface to be implemented by an object that |
| 20 // manages the lifetime of a DisplayManager, forwards events to the appropriate | 20 // manages the lifetime of a DisplayManager, forwards events to the appropriate |
| 21 // views, and responses to changes in viewport size. | 21 // views, and responses to changes in viewport size. |
| 22 class DisplayManagerDelegate { | 22 class DisplayManagerDelegate { |
| 23 public: | 23 public: |
| 24 // Returns the root view of this display. | 24 // Returns the root view of this display. |
| 25 virtual ServerView* GetRootView() = 0; | 25 virtual ServerView* GetRootView() = 0; |
| 26 | 26 |
| 27 // Called when the window managed by the DisplayManager is closed. | 27 // Called when the window managed by the DisplayManager is closed. |
| 28 virtual void OnDisplayClosed() = 0; | 28 virtual void OnDisplayClosed() = 0; |
| 29 | 29 |
| 30 // Called when an event arrives. | 30 // Called when an event arrives. |
| 31 virtual void OnEvent(mojo::EventPtr event) = 0; | 31 virtual void OnEvent(mojo::EventPtr event) = 0; |
| 32 | 32 |
| 33 // Signals that the metrics of this display's viewport has changed. | 33 // Signals that the metrics of this display's viewport has changed. |
| 34 virtual void OnViewportMetricsChanged( | 34 virtual void OnViewportMetricsChanged( |
| 35 const mojo::ViewportMetrics& old_metrics, | 35 const mojom::ViewportMetrics& old_metrics, |
| 36 const mojo::ViewportMetrics& new_metrics) = 0; | 36 const mojom::ViewportMetrics& new_metrics) = 0; |
| 37 | 37 |
| 38 virtual void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) = 0; | 38 virtual void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) = 0; |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 virtual ~DisplayManagerDelegate() {} | 41 virtual ~DisplayManagerDelegate() {} |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 } // namespace mus | 44 } // namespace mus |
| 45 | 45 |
| 46 #endif // COMPONENTS_MUS_WS_DISPLAY_MANAGER_DELEGATE_H_ | 46 #endif // COMPONENTS_MUS_WS_DISPLAY_MANAGER_DELEGATE_H_ |
| OLD | NEW |