summaryrefslogtreecommitdiffstats
path: root/components/mus/ws/window_server_delegate.h
blob: e7ca4a2e137fee85dfb0375f5e006ad74b38aea2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_MUS_WS_WINDOW_SERVER_DELEGATE_H_
#define COMPONENTS_MUS_WS_WINDOW_SERVER_DELEGATE_H_

#include <stdint.h>

#include <string>

#include "base/memory/scoped_ptr.h"
#include "components/mus/common/types.h"
#include "components/mus/public/interfaces/window_tree.mojom.h"
#include "mojo/public/cpp/bindings/interface_request.h"

namespace mus {

namespace mojom {
class Display;
class WindowManagerFactory;
class WindowTree;
}

namespace ws {

class Display;
class ServerWindow;
class WindowServer;
class WindowTree;
class WindowTreeBinding;

class WindowServerDelegate {
 public:
  // Called once when the AcceleratedWidget of a Display is available.
  virtual void OnFirstDisplayReady();

  virtual void OnNoMoreDisplays() = 0;

  // Creates a WindowTreeBinding in response to Embed() calls on the
  // WindowServer.
  virtual scoped_ptr<WindowTreeBinding> CreateWindowTreeBindingForEmbedAtWindow(
      ws::WindowServer* window_server,
      ws::WindowTree* tree,
      mojom::WindowTreeRequest tree_request,
      mojom::WindowTreeClientPtr client) = 0;

  // Called if no Displays have been created, but a WindowManagerFactory has
  // been set.
  virtual void CreateDefaultDisplays() = 0;

 protected:
  virtual ~WindowServerDelegate() {}
};

}  // namespace ws
}  // namespace mus

#endif  // COMPONENTS_MUS_WS_WINDOW_SERVER_DELEGATE_H_