OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ |
6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "components/mus/common/types.h" | 12 #include "components/mus/common/types.h" |
13 #include "components/mus/public/interfaces/window_tree.mojom.h" | 13 #include "components/mus/public/interfaces/window_tree.mojom.h" |
14 #include "mojo/public/cpp/bindings/interface_request.h" | 14 #include "mojo/public/cpp/bindings/interface_request.h" |
15 | 15 |
16 namespace mus { | 16 namespace mus { |
17 | 17 |
18 class Window; | 18 class Window; |
19 class WindowManagerDelegate; | 19 class WindowManagerDelegate; |
| 20 class WindowTreeConnectionObserver; |
20 class WindowTreeDelegate; | 21 class WindowTreeDelegate; |
21 | 22 |
22 // Encapsulates a connection to a window tree. A unique connection is made | 23 // Encapsulates a connection to a window tree. A unique connection is made |
23 // every time an app is embedded. | 24 // every time an app is embedded. |
24 class WindowTreeConnection { | 25 class WindowTreeConnection { |
25 public: | 26 public: |
26 enum class CreateType { | 27 enum class CreateType { |
27 // Indicates Create() should wait for OnEmbed(). If true, the | 28 // Indicates Create() should wait for OnEmbed(). If true, the |
28 // WindowTreeConnection returned from Create() will have its root, otherwise | 29 // WindowTreeConnection returned from Create() will have its root, otherwise |
29 // the WindowTreeConnection will get the root at a later time. | 30 // the WindowTreeConnection will get the root at a later time. |
(...skipping 30 matching lines...) Expand all Loading... |
60 // Windows are initially hidden, use SetVisible(true) to show. | 61 // Windows are initially hidden, use SetVisible(true) to show. |
61 Window* NewWindow() { return NewWindow(nullptr); } | 62 Window* NewWindow() { return NewWindow(nullptr); } |
62 virtual Window* NewWindow( | 63 virtual Window* NewWindow( |
63 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; | 64 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; |
64 | 65 |
65 // Returns true if ACCESS_POLICY_EMBED_ROOT was specified. | 66 // Returns true if ACCESS_POLICY_EMBED_ROOT was specified. |
66 virtual bool IsEmbedRoot() = 0; | 67 virtual bool IsEmbedRoot() = 0; |
67 | 68 |
68 // Returns the id for this connection. | 69 // Returns the id for this connection. |
69 virtual ConnectionSpecificId GetConnectionId() = 0; | 70 virtual ConnectionSpecificId GetConnectionId() = 0; |
| 71 |
| 72 virtual void AddObserver(WindowTreeConnectionObserver* observer) = 0; |
| 73 virtual void RemoveObserver(WindowTreeConnectionObserver* observer) = 0; |
70 }; | 74 }; |
71 | 75 |
72 } // namespace mus | 76 } // namespace mus |
73 | 77 |
74 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ | 78 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ |
OLD | NEW |