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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_MUS_DISPLAY_MANAGER_DELEGATE_H_
6 #define COMPONENTS_MUS_DISPLAY_MANAGER_DELEGATE_H_
8 #include "components/mus/ids.h"
9 #include "components/mus/public/interfaces/view_tree.mojom.h"
15 // A DisplayManagerDelegate an interface to be implemented by an object that
16 // manages the lifetime of a DisplayManager, forwards events to the appropriate
17 // views, and responses to changes in viewport size.
18 class DisplayManagerDelegate
{
20 // Returns the root view of this display.
21 virtual ServerView
* GetRootView() = 0;
23 // Called when the window managed by the DisplayManager is closed.
24 virtual void OnDisplayClosed() = 0;
26 // Called when an event arrives.
27 virtual void OnEvent(ViewId id
, mojo::EventPtr event
) = 0;
29 // Signals that the metrics of this display's viewport has changed.
30 virtual void OnViewportMetricsChanged(
31 const mojo::ViewportMetrics
& old_metrics
,
32 const mojo::ViewportMetrics
& new_metrics
) = 0;
35 virtual ~DisplayManagerDelegate() {}
40 #endif // COMPONENTS_MUS_DISPLAY_MANAGER_DELEGATE_H_