| 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/window_tree.mojom.h" | 15 #include "components/mus/public/interfaces/window_tree.mojom.h" |
| 16 #include "mojo/public/cpp/bindings/interface_request.h" | 16 #include "mojo/public/cpp/bindings/interface_request.h" |
| 17 | 17 |
| 18 namespace gfx { |
| 19 class Point; |
| 20 } |
| 21 |
| 18 namespace shell { | 22 namespace shell { |
| 19 class Connector; | 23 class Connector; |
| 20 } | 24 } |
| 21 | 25 |
| 22 namespace mus { | 26 namespace mus { |
| 23 | 27 |
| 24 class Window; | 28 class Window; |
| 25 class WindowManagerDelegate; | 29 class WindowManagerDelegate; |
| 26 class WindowTreeConnectionObserver; | 30 class WindowTreeConnectionObserver; |
| 27 class WindowTreeDelegate; | 31 class WindowTreeDelegate; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // input capture, or if another app has capture. | 74 // input capture, or if another app has capture. |
| 71 virtual Window* GetCaptureWindow() = 0; | 75 virtual Window* GetCaptureWindow() = 0; |
| 72 | 76 |
| 73 // Returns the focused window; null if focus is not yet known or another app | 77 // Returns the focused window; null if focus is not yet known or another app |
| 74 // is focused. | 78 // is focused. |
| 75 virtual Window* GetFocusedWindow() = 0; | 79 virtual Window* GetFocusedWindow() = 0; |
| 76 | 80 |
| 77 // Sets focus to null. This does nothing if focus is currently null. | 81 // Sets focus to null. This does nothing if focus is currently null. |
| 78 virtual void ClearFocus() = 0; | 82 virtual void ClearFocus() = 0; |
| 79 | 83 |
| 84 // Synchronously asks the window server for the current location of the mouse |
| 85 // cursor on screen. |
| 86 virtual gfx::Point GetCursorScreenPoint() = 0; |
| 87 |
| 80 // Creates and returns a new Window (which is owned by the window server). | 88 // Creates and returns a new Window (which is owned by the window server). |
| 81 // Windows are initially hidden, use SetVisible(true) to show. | 89 // Windows are initially hidden, use SetVisible(true) to show. |
| 82 Window* NewWindow() { return NewWindow(nullptr); } | 90 Window* NewWindow() { return NewWindow(nullptr); } |
| 83 virtual Window* NewWindow( | 91 virtual Window* NewWindow( |
| 84 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; | 92 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; |
| 85 virtual Window* NewTopLevelWindow( | 93 virtual Window* NewTopLevelWindow( |
| 86 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; | 94 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; |
| 87 | 95 |
| 88 // Returns the id for this connection. | 96 // Returns the id for this connection. |
| 89 // TODO(sky): remove this. It is not necessarily correct anymore. | 97 // TODO(sky): remove this. It is not necessarily correct anymore. |
| 90 virtual ConnectionSpecificId GetConnectionId() = 0; | 98 virtual ConnectionSpecificId GetConnectionId() = 0; |
| 91 | 99 |
| 92 virtual void AddObserver(WindowTreeConnectionObserver* observer) = 0; | 100 virtual void AddObserver(WindowTreeConnectionObserver* observer) = 0; |
| 93 virtual void RemoveObserver(WindowTreeConnectionObserver* observer) = 0; | 101 virtual void RemoveObserver(WindowTreeConnectionObserver* observer) = 0; |
| 94 }; | 102 }; |
| 95 | 103 |
| 96 } // namespace mus | 104 } // namespace mus |
| 97 | 105 |
| 98 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ | 106 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ |
| OLD | NEW |