Roll src/third_party/WebKit f298044:aa8346d (svn 202628:202629)
[chromium-blink-merge.git] / components / mus / display_manager_delegate.h
blob71c8967da766e70bcd032406e953c40f8ff6bf40
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"
11 namespace mus {
13 class ServerView;
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 {
19 public:
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;
34 protected:
35 virtual ~DisplayManagerDelegate() {}
38 } // namespace mus
40 #endif // COMPONENTS_MUS_DISPLAY_MANAGER_DELEGATE_H_