| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "components/mus/common/types.h" | 10 #include "components/mus/common/types.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void UpdateTextInputState(ServerWindow* window, | 87 void UpdateTextInputState(ServerWindow* window, |
| 88 const ui::TextInputState& state); | 88 const ui::TextInputState& state); |
| 89 void SetImeVisibility(ServerWindow* window, bool visible); | 89 void SetImeVisibility(ServerWindow* window, bool visible); |
| 90 | 90 |
| 91 // WindowTreeHost: | 91 // WindowTreeHost: |
| 92 void SetSize(mojo::SizePtr size) override; | 92 void SetSize(mojo::SizePtr size) override; |
| 93 void SetTitle(const mojo::String& title) override; | 93 void SetTitle(const mojo::String& title) override; |
| 94 void AddAccelerator(uint32_t id, | 94 void AddAccelerator(uint32_t id, |
| 95 mojom::EventMatcherPtr event_matcher) override; | 95 mojom::EventMatcherPtr event_matcher) override; |
| 96 void RemoveAccelerator(uint32_t id) override; | 96 void RemoveAccelerator(uint32_t id) override; |
| 97 void SetActivationParent(uint32_t window_id, bool enable) override; |
| 97 | 98 |
| 98 private: | 99 private: |
| 99 void OnClientClosed(); | 100 void OnClientClosed(); |
| 100 | 101 |
| 101 // DisplayManagerDelegate: | 102 // DisplayManagerDelegate: |
| 102 ServerWindow* GetRootWindow() override; | 103 ServerWindow* GetRootWindow() override; |
| 103 void OnEvent(mojom::EventPtr event) override; | 104 void OnEvent(mojom::EventPtr event) override; |
| 104 void OnDisplayClosed() override; | 105 void OnDisplayClosed() override; |
| 105 void OnViewportMetricsChanged( | 106 void OnViewportMetricsChanged( |
| 106 const mojom::ViewportMetrics& old_metrics, | 107 const mojom::ViewportMetrics& old_metrics, |
| 107 const mojom::ViewportMetrics& new_metrics) override; | 108 const mojom::ViewportMetrics& new_metrics) override; |
| 108 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override; | 109 void OnTopLevelSurfaceChanged(cc::SurfaceId surface_id) override; |
| 109 void OnCompositorFrameDrawn() override; | 110 void OnCompositorFrameDrawn() override; |
| 110 | 111 |
| 111 // FocusControllerDelegate: | 112 // FocusControllerDelegate: |
| 113 bool CanHaveActiveChildren(ServerWindow* window) const override; |
| 114 void OnActivationChanged(ServerWindow* old_active_window, |
| 115 ServerWindow* new_active_window) override; |
| 112 void OnFocusChanged(ServerWindow* old_focused_window, | 116 void OnFocusChanged(ServerWindow* old_focused_window, |
| 113 ServerWindow* new_focused_window) override; | 117 ServerWindow* new_focused_window) override; |
| 114 | 118 |
| 115 // EventDispatcherDelegate: | 119 // EventDispatcherDelegate: |
| 116 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override; | 120 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override; |
| 117 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; | 121 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; |
| 118 ServerWindow* GetFocusedWindowForEventDispatcher() override; | 122 ServerWindow* GetFocusedWindowForEventDispatcher() override; |
| 119 void DispatchInputEventToWindow(ServerWindow* target, | 123 void DispatchInputEventToWindow(ServerWindow* target, |
| 120 bool in_nonclient_area, | 124 bool in_nonclient_area, |
| 121 mojom::EventPtr event) override; | 125 mojom::EventPtr event) override; |
| 122 | 126 |
| 123 // ServerWindowObserver: | 127 // ServerWindowObserver: |
| 124 void OnWindowDestroyed(ServerWindow* window) override; | 128 void OnWindowDestroyed(ServerWindow* window) override; |
| 125 | 129 |
| 126 WindowTreeHostDelegate* delegate_; | 130 WindowTreeHostDelegate* delegate_; |
| 127 ConnectionManager* const connection_manager_; | 131 ConnectionManager* const connection_manager_; |
| 128 mojom::WindowTreeHostClientPtr client_; | 132 mojom::WindowTreeHostClientPtr client_; |
| 129 EventDispatcher event_dispatcher_; | 133 EventDispatcher event_dispatcher_; |
| 130 scoped_ptr<ServerWindow> root_; | 134 scoped_ptr<ServerWindow> root_; |
| 131 scoped_ptr<DisplayManager> display_manager_; | 135 scoped_ptr<DisplayManager> display_manager_; |
| 132 scoped_ptr<FocusController> focus_controller_; | 136 scoped_ptr<FocusController> focus_controller_; |
| 133 mojom::WindowManagerPtr window_manager_; | 137 mojom::WindowManagerPtr window_manager_; |
| 134 | 138 |
| 139 std::set<WindowId> activation_parents_; |
| 140 |
| 135 // Set of windows with surfaces that need to be destroyed once the frame | 141 // Set of windows with surfaces that need to be destroyed once the frame |
| 136 // draws. | 142 // draws. |
| 137 std::set<ServerWindow*> windows_needing_frame_destruction_; | 143 std::set<ServerWindow*> windows_needing_frame_destruction_; |
| 138 | 144 |
| 139 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); | 145 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); |
| 140 }; | 146 }; |
| 141 | 147 |
| 142 } // namespace ws | 148 } // namespace ws |
| 143 } // namespace mus | 149 } // namespace mus |
| 144 | 150 |
| 145 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ | 151 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ |
| OLD | NEW |