| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "components/mus/common/types.h" | 14 #include "components/mus/common/types.h" |
| 15 #include "components/mus/public/interfaces/input_event_constants.mojom.h" |
| 15 #include "components/mus/public/interfaces/window_tree.mojom.h" | 16 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 16 #include "mojo/public/cpp/bindings/interface_request.h" | 17 #include "mojo/public/cpp/bindings/interface_request.h" |
| 17 | 18 |
| 18 namespace shell { | 19 namespace shell { |
| 19 class Connector; | 20 class Connector; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace mus { | 23 namespace mus { |
| 23 | 24 |
| 24 class Window; | 25 class Window; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // input capture, or if another app has capture. | 71 // input capture, or if another app has capture. |
| 71 virtual Window* GetCaptureWindow() = 0; | 72 virtual Window* GetCaptureWindow() = 0; |
| 72 | 73 |
| 73 // Returns the focused window; null if focus is not yet known or another app | 74 // Returns the focused window; null if focus is not yet known or another app |
| 74 // is focused. | 75 // is focused. |
| 75 virtual Window* GetFocusedWindow() = 0; | 76 virtual Window* GetFocusedWindow() = 0; |
| 76 | 77 |
| 77 // Sets focus to null. This does nothing if focus is currently null. | 78 // Sets focus to null. This does nothing if focus is currently null. |
| 78 virtual void ClearFocus() = 0; | 79 virtual void ClearFocus() = 0; |
| 79 | 80 |
| 81 // See description in window_tree.mojom. When an existing event observer is |
| 82 // updated or cleared then any future events from the server for that observer |
| 83 // will be ignored. |
| 84 virtual void SetEventObserver(mojom::EventMatcherPtr matcher) = 0; |
| 85 |
| 80 // Creates and returns a new Window (which is owned by the window server). | 86 // Creates and returns a new Window (which is owned by the window server). |
| 81 // Windows are initially hidden, use SetVisible(true) to show. | 87 // Windows are initially hidden, use SetVisible(true) to show. |
| 82 Window* NewWindow() { return NewWindow(nullptr); } | 88 Window* NewWindow() { return NewWindow(nullptr); } |
| 83 virtual Window* NewWindow( | 89 virtual Window* NewWindow( |
| 84 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; | 90 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; |
| 85 virtual Window* NewTopLevelWindow( | 91 virtual Window* NewTopLevelWindow( |
| 86 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; | 92 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; |
| 87 | 93 |
| 88 // Returns the id for this connection. | 94 // Returns the id for this connection. |
| 89 // TODO(sky): remove this. It is not necessarily correct anymore. | 95 // TODO(sky): remove this. It is not necessarily correct anymore. |
| 90 virtual ConnectionSpecificId GetConnectionId() = 0; | 96 virtual ConnectionSpecificId GetConnectionId() = 0; |
| 91 | 97 |
| 92 virtual void AddObserver(WindowTreeConnectionObserver* observer) = 0; | 98 virtual void AddObserver(WindowTreeConnectionObserver* observer) = 0; |
| 93 virtual void RemoveObserver(WindowTreeConnectionObserver* observer) = 0; | 99 virtual void RemoveObserver(WindowTreeConnectionObserver* observer) = 0; |
| 94 }; | 100 }; |
| 95 | 101 |
| 96 } // namespace mus | 102 } // namespace mus |
| 97 | 103 |
| 98 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ | 104 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ |
| OLD | NEW |