OLD | NEW |
| (Empty) |
1 // Copyright 2014 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. | |
4 | |
5 #ifndef COMPONENTS_MUS_WS_WINDOW_SERVER_DELEGATE_H_ | |
6 #define COMPONENTS_MUS_WS_WINDOW_SERVER_DELEGATE_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include <memory> | |
11 #include <string> | |
12 | |
13 #include "components/mus/common/types.h" | |
14 #include "components/mus/public/interfaces/window_tree.mojom.h" | |
15 #include "mojo/public/cpp/bindings/interface_request.h" | |
16 | |
17 namespace mus { | |
18 | |
19 namespace mojom { | |
20 class Display; | |
21 class WindowManagerFactory; | |
22 class WindowTree; | |
23 } | |
24 | |
25 namespace ws { | |
26 | |
27 class Display; | |
28 class ServerWindow; | |
29 class WindowServer; | |
30 class WindowTree; | |
31 class WindowTreeBinding; | |
32 | |
33 class WindowServerDelegate { | |
34 public: | |
35 enum BindingType { | |
36 EMBED, | |
37 WINDOW_MANAGER, | |
38 }; | |
39 | |
40 // Called if no Displays have been created, but a WindowManagerFactory has | |
41 // been set. | |
42 virtual void CreateDefaultDisplays() = 0; | |
43 | |
44 // Called once when the AcceleratedWidget of a Display is available. | |
45 virtual void OnFirstDisplayReady(); | |
46 | |
47 virtual void OnNoMoreDisplays() = 0; | |
48 | |
49 virtual bool IsTestConfig() const = 0; | |
50 | |
51 // Creates a WindowTreeBinding. Default implementation returns null, which | |
52 // creates DefaultBinding. | |
53 virtual std::unique_ptr<WindowTreeBinding> CreateWindowTreeBinding( | |
54 BindingType type, | |
55 ws::WindowServer* window_server, | |
56 ws::WindowTree* tree, | |
57 mojom::WindowTreeRequest* tree_request, | |
58 mojom::WindowTreeClientPtr* client); | |
59 | |
60 protected: | |
61 virtual ~WindowServerDelegate() {} | |
62 }; | |
63 | |
64 } // namespace ws | |
65 } // namespace mus | |
66 | |
67 #endif // COMPONENTS_MUS_WS_WINDOW_SERVER_DELEGATE_H_ | |
OLD | NEW |