| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_WS_WINDOW_TREE_HOST_IMPL_H_ | 5 #ifndef COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ |
| 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ | 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 ConnectionManager* connection_manager() { return connection_manager_; } | 93 ConnectionManager* connection_manager() { return connection_manager_; } |
| 94 | 94 |
| 95 mojom::WindowManagerDeprecated* window_manager() { | 95 mojom::WindowManagerDeprecated* window_manager() { |
| 96 return window_manager_.get(); | 96 return window_manager_.get(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 // Returns the root ServerWindow of this viewport. | 99 // Returns the root ServerWindow of this viewport. |
| 100 ServerWindow* root_window() { return root_.get(); } | 100 ServerWindow* root_window() { return root_.get(); } |
| 101 const ServerWindow* root_window() const { return root_.get(); } | 101 const ServerWindow* root_window() const { return root_.get(); } |
| 102 | 102 |
| 103 void SetCapture(ServerWindow* window, bool in_nonclient_area); |
| 104 void ReleaseCapture(ServerWindow* window); |
| 105 |
| 103 void SetFocusedWindow(ServerWindow* window); | 106 void SetFocusedWindow(ServerWindow* window); |
| 104 ServerWindow* GetFocusedWindow(); | 107 ServerWindow* GetFocusedWindow(); |
| 105 void DestroyFocusController(); | 108 void DestroyFocusController(); |
| 106 | 109 |
| 107 void UpdateTextInputState(ServerWindow* window, | 110 void UpdateTextInputState(ServerWindow* window, |
| 108 const ui::TextInputState& state); | 111 const ui::TextInputState& state); |
| 109 void SetImeVisibility(ServerWindow* window, bool visible); | 112 void SetImeVisibility(ServerWindow* window, bool visible); |
| 110 | 113 |
| 114 // Returns the window that has captured input. |
| 115 ServerWindow* GetCaptureWindow() { |
| 116 return event_dispatcher_.capture_window(); |
| 117 } |
| 118 const ServerWindow* GetCaptureWindow() const { |
| 119 return event_dispatcher_.capture_window(); |
| 120 } |
| 121 |
| 111 // Called just before |tree| is destroyed after its connection encounters an | 122 // Called just before |tree| is destroyed after its connection encounters an |
| 112 // error. | 123 // error. |
| 113 void OnWindowTreeConnectionError(WindowTreeImpl* tree); | 124 void OnWindowTreeConnectionError(WindowTreeImpl* tree); |
| 114 | 125 |
| 115 // Called when a client updates a cursor. This will update the cursor on the | 126 // Called when a client updates a cursor. This will update the cursor on the |
| 116 // native display if the cursor is currently under |window|. | 127 // native display if the cursor is currently under |window|. |
| 117 void OnCursorUpdated(ServerWindow* window); | 128 void OnCursorUpdated(ServerWindow* window); |
| 118 | 129 |
| 119 // Called when the window tree when stacking and bounds of a window | 130 // Called when the window tree when stacking and bounds of a window |
| 120 // change. This may update the cursor if the ServerWindow under the last | 131 // change. This may update the cursor if the ServerWindow under the last |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // Dispatches the event to the appropriate client and starts the ack timer. | 190 // Dispatches the event to the appropriate client and starts the ack timer. |
| 180 void DispatchInputEventToWindowImpl(ServerWindow* target, | 191 void DispatchInputEventToWindowImpl(ServerWindow* target, |
| 181 bool in_nonclient_area, | 192 bool in_nonclient_area, |
| 182 mojom::EventPtr event); | 193 mojom::EventPtr event); |
| 183 | 194 |
| 184 void UpdateNativeCursor(int32_t cursor_id); | 195 void UpdateNativeCursor(int32_t cursor_id); |
| 185 | 196 |
| 186 // DisplayManagerDelegate: | 197 // DisplayManagerDelegate: |
| 187 ServerWindow* GetRootWindow() override; | 198 ServerWindow* GetRootWindow() override; |
| 188 void OnEvent(const ui::Event& event) override; | 199 void OnEvent(const ui::Event& event) override; |
| 200 void OnLostCapture() override; |
| 189 void OnDisplayClosed() override; | 201 void OnDisplayClosed() override; |
| 190 void OnViewportMetricsChanged( | 202 void OnViewportMetricsChanged( |
| 191 const mojom::ViewportMetrics& old_metrics, | 203 const mojom::ViewportMetrics& old_metrics, |
| 192 const mojom::ViewportMetrics& new_metrics) override; | 204 const mojom::ViewportMetrics& new_metrics) override; |
| 193 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override; | 205 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override; |
| 194 void OnCompositorFrameDrawn() override; | 206 void OnCompositorFrameDrawn() override; |
| 195 | 207 |
| 196 // FocusControllerDelegate: | 208 // FocusControllerDelegate: |
| 197 bool CanHaveActiveChildren(ServerWindow* window) const override; | 209 bool CanHaveActiveChildren(ServerWindow* window) const override; |
| 198 | 210 |
| 199 // FocusControllerObserver: | 211 // FocusControllerObserver: |
| 200 void OnActivationChanged(ServerWindow* old_active_window, | 212 void OnActivationChanged(ServerWindow* old_active_window, |
| 201 ServerWindow* new_active_window) override; | 213 ServerWindow* new_active_window) override; |
| 202 void OnFocusChanged(FocusControllerChangeSource change_source, | 214 void OnFocusChanged(FocusControllerChangeSource change_source, |
| 203 ServerWindow* old_focused_window, | 215 ServerWindow* old_focused_window, |
| 204 ServerWindow* new_focused_window) override; | 216 ServerWindow* new_focused_window) override; |
| 205 | 217 |
| 206 // EventDispatcherDelegate: | 218 // EventDispatcherDelegate: |
| 207 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override; | 219 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override; |
| 208 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; | 220 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; |
| 209 ServerWindow* GetFocusedWindowForEventDispatcher() override; | 221 ServerWindow* GetFocusedWindowForEventDispatcher() override; |
| 222 void OnLostCapture(ServerWindow* window) override; |
| 210 void DispatchInputEventToWindow(ServerWindow* target, | 223 void DispatchInputEventToWindow(ServerWindow* target, |
| 211 bool in_nonclient_area, | 224 bool in_nonclient_area, |
| 212 mojom::EventPtr event) override; | 225 mojom::EventPtr event) override; |
| 213 | 226 |
| 214 // ServerWindowObserver: | 227 // ServerWindowObserver: |
| 215 void OnWindowDestroyed(ServerWindow* window) override; | 228 void OnWindowDestroyed(ServerWindow* window) override; |
| 216 | 229 |
| 217 const uint32_t id_; | 230 const uint32_t id_; |
| 218 WindowTreeHostDelegate* delegate_; | 231 WindowTreeHostDelegate* delegate_; |
| 219 ConnectionManager* const connection_manager_; | 232 ConnectionManager* const connection_manager_; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 239 | 252 |
| 240 mojom::FrameDecorationValuesPtr frame_decoration_values_; | 253 mojom::FrameDecorationValuesPtr frame_decoration_values_; |
| 241 | 254 |
| 242 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); | 255 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); |
| 243 }; | 256 }; |
| 244 | 257 |
| 245 } // namespace ws | 258 } // namespace ws |
| 246 } // namespace mus | 259 } // namespace mus |
| 247 | 260 |
| 248 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ | 261 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ |
| OLD | NEW |