Chromium Code Reviews| 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 // Performs additional initialization so that we can synchronously retrieve | |
| 85 // the cursor location. | |
| 86 virtual void InitializeCursorLocation() = 0; | |
| 87 | |
| 88 // Returns the current location of the mouse on screen. Note: this method may | |
| 89 // race the asynchronous initialization; but in that case we just will return | |
|
sky
2016/04/20 23:46:36
nit: remove 'just will'
| |
| 90 // (0, 0). | |
| 91 virtual gfx::Point GetCursorScreenPoint() = 0; | |
| 92 | |
| 80 // Creates and returns a new Window (which is owned by the window server). | 93 // Creates and returns a new Window (which is owned by the window server). |
| 81 // Windows are initially hidden, use SetVisible(true) to show. | 94 // Windows are initially hidden, use SetVisible(true) to show. |
| 82 Window* NewWindow() { return NewWindow(nullptr); } | 95 Window* NewWindow() { return NewWindow(nullptr); } |
| 83 virtual Window* NewWindow( | 96 virtual Window* NewWindow( |
| 84 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; | 97 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; |
| 85 virtual Window* NewTopLevelWindow( | 98 virtual Window* NewTopLevelWindow( |
| 86 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; | 99 const std::map<std::string, std::vector<uint8_t>>* properties) = 0; |
| 87 | 100 |
| 88 // Returns the id for this connection. | 101 // Returns the id for this connection. |
| 89 // TODO(sky): remove this. It is not necessarily correct anymore. | 102 // TODO(sky): remove this. It is not necessarily correct anymore. |
| 90 virtual ConnectionSpecificId GetConnectionId() = 0; | 103 virtual ConnectionSpecificId GetConnectionId() = 0; |
| 91 | 104 |
| 92 virtual void AddObserver(WindowTreeConnectionObserver* observer) = 0; | 105 virtual void AddObserver(WindowTreeConnectionObserver* observer) = 0; |
| 93 virtual void RemoveObserver(WindowTreeConnectionObserver* observer) = 0; | 106 virtual void RemoveObserver(WindowTreeConnectionObserver* observer) = 0; |
| 94 }; | 107 }; |
| 95 | 108 |
| 96 } // namespace mus | 109 } // namespace mus |
| 97 | 110 |
| 98 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ | 111 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_TREE_CONNECTION_H_ |
| OLD | NEW |