| 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> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "components/mus/common/types.h" | 15 #include "components/mus/common/types.h" |
| 16 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" |
| 16 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 17 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
| 17 #include "components/mus/ws/display_manager.h" | 18 #include "components/mus/ws/display_manager.h" |
| 18 #include "components/mus/ws/event_dispatcher.h" | 19 #include "components/mus/ws/event_dispatcher.h" |
| 19 #include "components/mus/ws/event_dispatcher_delegate.h" | 20 #include "components/mus/ws/event_dispatcher_delegate.h" |
| 20 #include "components/mus/ws/focus_controller_delegate.h" | 21 #include "components/mus/ws/focus_controller_delegate.h" |
| 21 #include "components/mus/ws/focus_controller_observer.h" | 22 #include "components/mus/ws/focus_controller_observer.h" |
| 22 #include "components/mus/ws/server_window.h" | 23 #include "components/mus/ws/server_window.h" |
| 23 #include "components/mus/ws/server_window_observer.h" | 24 #include "components/mus/ws/server_window_observer.h" |
| 24 | 25 |
| 25 namespace mus { | 26 namespace mus { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 56 // Initializes state that depends on the existence of a WindowTreeHostImpl. | 57 // Initializes state that depends on the existence of a WindowTreeHostImpl. |
| 57 void Init(WindowTreeHostDelegate* delegate); | 58 void Init(WindowTreeHostDelegate* delegate); |
| 58 | 59 |
| 59 uint32_t id() const { return id_; } | 60 uint32_t id() const { return id_; } |
| 60 | 61 |
| 61 const WindowTreeImpl* GetWindowTree() const; | 62 const WindowTreeImpl* GetWindowTree() const; |
| 62 WindowTreeImpl* GetWindowTree(); | 63 WindowTreeImpl* GetWindowTree(); |
| 63 | 64 |
| 64 mojom::WindowTreeHostClient* client() const { return client_.get(); } | 65 mojom::WindowTreeHostClient* client() const { return client_.get(); } |
| 65 | 66 |
| 67 void SetFrameDecorationValues(mojom::FrameDecorationValuesPtr values); |
| 68 const mojom::FrameDecorationValues& frame_decoration_values() const { |
| 69 return *frame_decoration_values_; |
| 70 } |
| 71 |
| 66 // Returns whether |window| is a descendant of this root but not itself a | 72 // Returns whether |window| is a descendant of this root but not itself a |
| 67 // root window. | 73 // root window. |
| 68 bool IsWindowAttachedToRoot(const ServerWindow* window) const; | 74 bool IsWindowAttachedToRoot(const ServerWindow* window) const; |
| 69 | 75 |
| 70 // Schedules a paint for the specified region in the coordinates of |window| | 76 // Schedules a paint for the specified region in the coordinates of |window| |
| 71 // if | 77 // if |
| 72 // the |window| is in this viewport. Returns whether |window| is in the | 78 // the |window| is in this viewport. Returns whether |window| is in the |
| 73 // viewport. | 79 // viewport. |
| 74 bool SchedulePaintIfInViewport(const ServerWindow* window, | 80 bool SchedulePaintIfInViewport(const ServerWindow* window, |
| 75 const gfx::Rect& bounds); | 81 const gfx::Rect& bounds); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override; | 203 void OnAccelerator(uint32_t accelerator_id, mojom::EventPtr event) override; |
| 198 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; | 204 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; |
| 199 ServerWindow* GetFocusedWindowForEventDispatcher() override; | 205 ServerWindow* GetFocusedWindowForEventDispatcher() override; |
| 200 void DispatchInputEventToWindow(ServerWindow* target, | 206 void DispatchInputEventToWindow(ServerWindow* target, |
| 201 bool in_nonclient_area, | 207 bool in_nonclient_area, |
| 202 mojom::EventPtr event) override; | 208 mojom::EventPtr event) override; |
| 203 | 209 |
| 204 // ServerWindowObserver: | 210 // ServerWindowObserver: |
| 205 void OnWindowDestroyed(ServerWindow* window) override; | 211 void OnWindowDestroyed(ServerWindow* window) override; |
| 206 | 212 |
| 213 const uint32_t id_; |
| 207 WindowTreeHostDelegate* delegate_; | 214 WindowTreeHostDelegate* delegate_; |
| 208 ConnectionManager* const connection_manager_; | 215 ConnectionManager* const connection_manager_; |
| 209 mojom::WindowTreeHostClientPtr client_; | 216 mojom::WindowTreeHostClientPtr client_; |
| 210 EventDispatcher event_dispatcher_; | 217 EventDispatcher event_dispatcher_; |
| 211 scoped_ptr<ServerWindow> root_; | 218 scoped_ptr<ServerWindow> root_; |
| 212 scoped_ptr<DisplayManager> display_manager_; | 219 scoped_ptr<DisplayManager> display_manager_; |
| 213 scoped_ptr<FocusController> focus_controller_; | 220 scoped_ptr<FocusController> focus_controller_; |
| 214 mojom::WindowManagerPtr window_manager_; | 221 mojom::WindowManagerPtr window_manager_; |
| 215 mojom::WindowTree* tree_awaiting_input_ack_; | 222 mojom::WindowTree* tree_awaiting_input_ack_; |
| 216 | 223 |
| 217 // The last cursor set. Used to track whether we need to change the cursor. | 224 // The last cursor set. Used to track whether we need to change the cursor. |
| 218 int32_t last_cursor_; | 225 int32_t last_cursor_; |
| 219 | 226 |
| 220 std::set<WindowId> activation_parents_; | 227 std::set<WindowId> activation_parents_; |
| 221 | 228 |
| 222 // Set of windows with surfaces that need to be destroyed once the frame | 229 // Set of windows with surfaces that need to be destroyed once the frame |
| 223 // draws. | 230 // draws. |
| 224 std::set<ServerWindow*> windows_needing_frame_destruction_; | 231 std::set<ServerWindow*> windows_needing_frame_destruction_; |
| 225 | 232 |
| 226 std::queue<scoped_ptr<QueuedEvent>> event_queue_; | 233 std::queue<scoped_ptr<QueuedEvent>> event_queue_; |
| 227 base::OneShotTimer event_ack_timer_; | 234 base::OneShotTimer event_ack_timer_; |
| 228 | 235 |
| 229 const uint32_t id_; | 236 mojom::FrameDecorationValuesPtr frame_decoration_values_; |
| 230 | 237 |
| 231 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); | 238 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); |
| 232 }; | 239 }; |
| 233 | 240 |
| 234 } // namespace ws | 241 } // namespace ws |
| 235 } // namespace mus | 242 } // namespace mus |
| 236 | 243 |
| 237 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ | 244 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ |
| OLD | NEW |